summaryrefslogtreecommitdiff
path: root/Zend/zend_operators.h
Commit message (Collapse)AuthorAgeFilesLines
* bump yearXinchen Hui2015-01-151-1/+1
|
* add T_POW (**) operatordatibbaw2014-02-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed recognition of the operator Added opcode, still doing multiply instead of pow() opcode now always returns int(42) The right answer, but always a float Yanked code from pow() implementation. Should not handle negative long as exponent ourselves Added test cases from pow() Moved precedence higher than '~' Added GMP operator overloading Added ZEND_ASSIGN_POW (**=) operator. Added pow() as a language construct. Adjusted test cases for changed precedence. Reduced pow() to shell function around ZEND_API pow_function() Reduced test case to only contain edge cases Added overloading test case Moved unary minus above T_POW Revert "Added pow() as a language construct." Bad bad bad idea. This reverts commit f60b98cf7a8371233d800a6faa286ddba4432d02. Reverted unary minus behaviour due to previous revert. Convert arrays to int(0) Exponent with array as a base becomes int(0) Rebase against master Fixed tokenizer test case
* Bump yearXinchen Hui2014-01-031-1/+1
|
* Zend: fix overflow handling bug in non-x86 fast_add_function()Ard Biesheuvel2013-12-101-2/+7
| | | | | | The 'result' argument of fast_add_function() may alias with either of its operands (or both). Take care not to write to 'result' before reading op1 and op2.
* Merge branch 'const_scalar_exprs' into PHP-5.6Bob Weinand2013-11-281-0/+3
|\ | | | | | | | | Conflicts: Zend/zend_extensions.h
| * Constant expressions refactoringDmitry Stogov2013-11-061-4/+0
| |
| * Added a few more operatorsBob Weinand2013-11-031-0/+2
| |
| * Fixed mem leaks, added tests and ternary operatorBob Weinand2013-10-311-0/+2
| |
| * Working commit for constant scalar expressions (with constants).Bob Weinand2013-10-311-0/+3
| | | | | | | | Tests will follow.
* | Merge branch 'PHP-5.5' into PHP-5.6Anatol Belski2013-11-201-0/+2
|\ \ | |/ |/| | | | | * PHP-5.5: permanently deactivate that place, not on runtime only
| * Merge branch 'PHP-5.4' into PHP-5.5Anatol Belski2013-11-201-0/+2
| |\ | | | | | | | | | | | | * PHP-5.4: permanently deactivate that place, not on runtime only
| | * permanently deactivate that place, not on runtime onlyAnatol Belski2013-11-201-0/+2
| | | | | | | | | | | | | | | besides the two "if" checks, this fixes static analyze which is sometimes broken because of this
* | | Merge branch 'PHP-5.5'Xinchen Hui2013-08-271-1/+1
|\ \ \ | |/ /
| * | Fixed compiler warningsXinchen Hui2013-08-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | warning: 'local_dval' may be used uninitialized in this function [-Wmaybe-uninitialized] warning: 'dval2' may be used uninitialized in this function [-Wmaybe-uninitialized]
* | | Constify streams API and a few other calls down the rabbit hole.Andrey Hristov2013-07-301-4/+4
| | | | | | | | | | | | | | | (`char *` to `const char *` for parameters and few return values) In a few places int len moved to size_t len.
* | | Implement internal operator overloadingNikita Popov2013-06-171-0/+18
|/ / | | | | | | As pre RFC https://wiki.php.net/rfc/operator_overloading_gmp
* | Fix #64780 (PHP 5.5 builds are broken with GCC 3)Ard Biesheuvel2013-05-071-1/+5
| | | | | | | | | | | | | | | | | | A recent change (by me) introduced a call to __builtin_offsetof() into zend_operators.h which is not defined by GCC prior to version 4. Changed the code to use offsetof() instead: this is defined in <stddef.h>, so #include this header conditionally (#ifdef GNUC)
* | Fix rounding of zend_dval_to_lvalGustavo Lopes2013-02-231-1/+5
| | | | | | | | | | | | Now rounding is always towards zero; the rounding can be though as if occurring on the original double. Only relevant for the 32-bit long variant.
* | Fix zend_dval_to_lval outside 64bit integers rangeGustavo Lopes2013-02-231-6/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PHP should preserve the least significant bits when casting from double to long. Zend.m4 contains this: AC_DEFINE([ZEND_DVAL_TO_LVAL_CAST_OK], 1, [Define if double cast to long preserves least significant bits]) If ZEND_DVAL_TO_LVAL_CAST_OK is not defined, zend_operators.h had an inline implementation of zend_dval_to_lval() that would do a cast to an int64_t (when sizeof(long) == 4), then a cast to unsigned long and finally the cast to long. While this works well for doubles inside the range of values of the type used in the first cast (int64_t in the 32-bit version and unsigned long in the 64-bit version), if outside the range, it is undefined behavior that WILL give varying and not particularly useful results. This commit uses fmod() to first put the double in a range that can safely be cast to unsigned long and then casts this unsigned long to long. This last cast is implementation defined, but it's very likely that this gives the expected result (i.e. the internal 2's complement representation is unchanged) on all platforms that PHP supports. In any case, the previous implementationa already had this assumption. This alternative code path is indeed significantly slower than simply casting the double (almost an order of magnitude), but that should not matter because casting doubles with a very high absolute value is a rare event.
* | Improve x86 inline assemblerArd Biesheuvel2013-02-111-32/+60
| | | | | | | | | | | | | | - added cc annotation to inline asm that clobbers the condition flags - remove hardcoded constants (IS_LONG,IS_DOUBLE) - remove hardcoded offsets (zval->value, zval->type)
* | Merge branch 'PHP-5.4' into PHP-5.5Remi Collet2013-02-111-1/+2
|\ \ | |/ | | | | | | * PHP-5.4: Fixed bug #64142 (dval to lval different behavior on ppc64)
| * Fixed bug #64142 (dval to lval different behavior on ppc64)Remi Collet2013-02-111-1/+2
| | | | | | | | | | See discussion on internals http://marc.info/?t=136042277700003&r=1&w=2
* | Merge branch 'PHP-5.4' into PHP-5.5Remi Collet2013-02-051-1/+1
|\ \ | |/ | | | | | | * PHP-5.4: revert
| * revertRemi Collet2013-02-051-1/+1
| |
* | Merge branch 'PHP-5.4' into PHP-5.5Remi Collet2013-02-041-1/+1
|\ \ | |/ | | | | | | * PHP-5.4: Fixed bug #64142 (dval to lval different behavior on ppc64)
| * Fixed bug #64142 (dval to lval different behavior on ppc64)Remi Collet2013-02-041-1/+1
| | | | | | | | | | | | | | On x86_64: (long)(double)9223372036854775807+1 = -9223372036854775808 On ppc64 (long)(double)9223372036854775807-1 = 9223372036854775807
| * Happy New YearXinchen Hui2013-01-011-1/+1
| |
| * fix bug #54547Stanislav Malyshev2012-05-131-2/+22
| |
| * - Year++Felipe Pena2012-01-011-1/+1
| |
| * Fixed bug #55644 (Math ops tests fail, diff min int value)Dmitry Stogov2011-09-161-1/+1
| |
| * - Zend engine part for bug #55158: Add SORT_NATURAL type to array_multisortDerick Rethans2011-08-291-0/+2
| | | | | | | | | | (patch by Arpad Ray).
| * For 5.4, fix C++-style comments. For trunk, forward-port build fix.Gwynne Raskind2011-08-071-2/+2
| |
| * Fix build under Clang 2.9 - see LLVM bug #9164 ↵Gwynne Raskind2011-08-071-0/+8
| | | | | | | | (http://llvm.org/bugs/show_bug.cgi?id=9164). Tested with GCC and Clang on Darwin and Ubuntu.
| * - Removed accidental offsetof definitionFelipe Pena2011-07-031-5/+0
| |
| * - Fixed compiler warning (redefinition of offsetof)Felipe Pena2011-06-181-0/+2
| |
| * MFH: Arithmetic speedup. Inlined most probable code-paths for arithmetic ↵Dmitry Stogov2011-05-311-0/+416
| | | | | | | | operations directly into executor.
* | Bug #46408: Fix double formatting for PostgreSQL bound parametersLars Strojny2013-01-141-0/+2
| |
* | Happy New YearXinchen Hui2013-01-011-1/+1
| |
* | zend_binary_strncasecmp_l used w/out declarationGustavo Lopes2012-08-261-0/+1
| |
* | fix bug #54547Stanislav Malyshev2012-05-141-2/+22
| |
* | - Year++Felipe Pena2012-01-011-1/+1
| |
* | Fixed bug #55644 (Math ops tests fail, diff min int value)Dmitry Stogov2011-09-161-1/+1
| |
* | - Zend engine part for bug #55158: Add SORT_NATURAL type to array_multisortDerick Rethans2011-08-291-0/+2
| | | | | | | | | | (patch by Arpad Ray).
* | For 5.4, fix C++-style comments. For trunk, forward-port build fix.Gwynne Raskind2011-08-071-0/+8
| |
* | - should not have been appliedPierre Joye2011-07-221-0/+1
| |
* | - remove magic quotes support, functions are kept (see the NEWS entry for ↵Pierre Joye2011-07-221-1/+0
| | | | | | | | the details) for BC reasons but do not allow to set enable MQ
* | - Removed accidental offsetof definitionFelipe Pena2011-07-031-5/+0
| |
* | - Fixed compiler warning (redefinition of offsetof)Felipe Pena2011-06-181-0/+2
| |
* | Arithmetic speedup. Inlined most probable code-paths for arithmetic ↵Dmitry Stogov2011-05-231-0/+416
|/ | | | operations directly into executor.
* - Year++Felipe Pena2011-01-011-1/+1
|