Commit Graph

468 Commits

Author SHA1 Message Date
Dmitry Stogov
37f0c6b5cb Add myself into list of authors of the most refactored files. 2015-08-31 11:38:16 +03:00
Dmitry Stogov
9d31b29705 Avoid array duplication 2015-08-25 22:40:33 +03:00
Nikita Popov
0039a3e96f Fixed signed/unsigned warnings in wddx
Also added extra const annotation to zend_memnstr.
2015-07-17 17:19:23 +02:00
Xinchen Hui
e5a996f268 Fixed bug #70057 (Build failure on 32-bit Mac OS X 10.6.8: recursive inlining) 2015-07-13 16:22:55 +08:00
Aaron Piotrowski
5df893ce3c Use NULL where possible for exception class
Matches usage of zend_throw_exception()/zend_throw_exception_ex().
2015-07-07 12:10:55 -05:00
Anatol Belski
a97f764472 bring back the division by zero warning 2015-07-05 20:18:17 +02:00
Aaron Piotrowski
22c38b2ef5 Remove need to pass error level 2015-07-03 17:53:41 -05:00
Aaron Piotrowski
5a99c07ecc Enable throwing custom exceptions from errors 2015-07-03 17:53:40 -05:00
Bob Weinand
94722e12cf Introduce ArithmeticError 2015-07-02 20:47:44 +02:00
Xinchen Hui
ba91bc36cd Same here 2015-07-02 12:23:50 +08:00
Xinchen Hui
ba711aec30 Use one_char_string 2015-07-02 12:19:55 +08:00
Xinchen Hui
0e68e27854 Use one_char_string 2015-07-02 12:18:23 +08:00
Bob Weinand
007d7ac7ca Use DivisionByZeroError instead of exception for %/intdiv() 2015-07-02 02:20:58 +02:00
Bob Weinand
f9724b93f6 Remove warning upon division by zero 2015-07-02 02:20:58 +02:00
Dmitry Stogov
d2d326a381 Cleanup (avoid reallocatios and side effects in php_strip_tags) 2015-07-01 19:04:18 +03:00
Dmitry Stogov
7aa7627172 Use ZSTR_ API to access zend_string elements (this is just renaming without semantick changes). 2015-06-30 13:59:27 +03:00
Dmitry Stogov
4bd22cf1c1 Improved zend_string API (Francois Laupretre)
Squashed commit of the following:

commit d96eab8d79
Author: Francois Laupretre <francois@tekwire.net>
Date:   Fri Jun 26 01:23:31 2015 +0200

    Use the new 'ZSTR' macros in the rest of the code.

    Does not change anything to the generated code (thanks to compat macros) but cleaner.

commit b352643910
Author: Francois Laupretre <francois@tekwire.net>
Date:   Thu Jun 25 13:45:06 2015 +0200

    Improve zend_string API

    Add missing methods
2015-06-29 16:44:54 +03:00
Dmitry Stogov
1bba4452e7 Reverted wrong fb08798c9f 2015-06-29 12:20:09 +03:00
Bob Weinand
fb08798c9f Fix bug #69957 (Different ways of handling div/mod by zero) 2015-06-28 18:22:59 +02:00
Nikita Popov
8a83aed458 Drop duplicate object-to-type notices
We already generate a recoverable fatal for these earlier, no need
to throw an additional notice.
2015-06-22 16:25:32 +02:00
Dmitry Stogov
b97df475df Fixed crash in Zend/tests/bug69891.phpt on x86 (32-bit).
compare_function() now has to be compatible with binary_op_type (use fastcall convention).
Introduced new zval_compare_function() to be used as zval comparison callback instead of compare_function().
2015-06-22 12:53:52 +03:00
Dmitry Stogov
4a6e1345e2 Use COW to prevent unnecessary duplication of dynamic propertyes of stdClass (and other classes without predefined properties). 2015-06-17 12:50:16 +03:00
Nikita Popov
fb346c8f93 Support references in convert_to_*
conver_to_* functions now accept REFERENCE values, which will be
unwrapped before performing the usual conversion. This is consistent
with convert_scalar_to_number and matches the expected behavior in
a couple random use-sites I checked.

Also includes a couple fixes/cleanups elsewhere and two tests for
cases that previously didn't work (though the reference issue existed
all over the place).
2015-06-16 19:55:33 +02:00
Nikita Popov
183c00ddb6 Fix references handling in convert_scalar_to_number 2015-06-16 18:02:45 +02:00
Nikita Popov
5d3cf577aa Make convert_to_* safe with rc>1
This only involves switching zval_dtor to zval_ptr_dtor for arrays
and making the convert_to_object for arrays a bit more generic.

All the other changes outside zend_operators.c just make use of
this new ability (use COPY instead of DUP).

What's still missing: Proper references handling. I've seen many
convert_to* calls that will break when a reference is used.

Also fixes bug #69788.
2015-06-11 23:23:57 +02:00
Bob Weinand
9ca564d5f3 fix bitwise object operations 2015-06-04 16:09:22 +02:00
Bob Weinand
8a1c5d15d2 Use CG(one_char_string) if possible in bitwise string operations
emalloc() is not cheap... Also, a good part of bitwise string ops out there are on single bytes.
2015-06-03 02:57:16 +02:00
Dmitry Stogov
5fc88a9968 Inline IS_LONG value calculation and avoid strtol() call. 2015-05-05 11:09:18 +03:00
Dmitry Stogov
d880ead8a7 Improve fast_is_[not_]identical() functions to teturn value instead of takeing additional arguments.
Pair INSTANCEOF with the following JMPZ/JMPNZ.
2015-04-29 16:43:23 +03:00
Nikita Popov
23c7f19e41 Undef results for new arithmetic exceptions
For the compound assing case (e.g. $a <<= $b) the result is going
to be dtored, so we have to set *some* value.
2015-04-06 21:52:20 +02:00
Dmitry Stogov
5820be029a 0.0 / 0.0 = NaN 2015-04-06 22:03:44 +03:00
Anatol Belski
f0c533f421 fix build 2015-04-06 13:56:47 +02:00
Dmitry Stogov
cae0147ed3 Fixed weird operators behavior. Division by zero now emits warning and returns +/-INF, modulo by zero and intdid() throws an exception, shifts by negative offset throw exceptions. Compile-time evaluation of division by zero is disabled. 2015-04-06 14:30:05 +03:00
Dmitry Stogov
53d20140fb Fixed performance degradation introduced with lateast EnfineException related changes.
Restore original errors order in executor.
2015-04-02 03:56:42 +03:00
Dmitry Stogov
ec760d8fff Convert fatal errors into EngineExceptions 2015-04-01 20:01:57 +03:00
Dmitry Stogov
780a8123fe Convert fatal errors into EngineExceptions 2015-04-01 16:48:15 +03:00
Dmitry Stogov
e8672deefc Convert "Unsupported operands" fatal error into EngineException (exceptions can't be thrown at compile-time yet, so unsuported operands in constant expressions are still lead to fatal error). 2015-03-31 13:25:26 +03:00
Dmitry Stogov
0ce7b4c8c6 Removed unused functions 2015-03-24 23:40:20 +03:00
Dmitry Stogov
d146d15003 Optimize zend_string_realloc() add more specialized versions zend_string_extend() and zend_string_truncate() 2015-03-20 02:02:42 +03:00
Dmitry Stogov
4d4a5336f1 Embed "fast" operator functions (add, sub, increment, etc) into executor with additional optimizations 2015-03-17 18:53:19 +03:00
Dmitry Stogov
f42ebdd4e9 Fixed inconsistency 2015-03-14 15:11:55 +03:00
Dmitry Stogov
db10b72523 Use fastcall calling convention for most critical ZE subsystems. 2015-03-13 21:10:09 +03:00
Dmitry Stogov
716da71446 Don't inline slow path 2015-02-26 01:28:47 +03:00
Dmitry Stogov
e10e151e9b Merged zend_array and HashTable into the single data structure.
Now each HashTable is also zend_array, so it's refcounted and may be a subject for Copy on Write
zend_array_dup() was changed to allocate and return HashTable, instead of taking preallocated HashTable as argument.
2015-02-13 22:20:39 +03:00
Nikita Popov
d133e68bab Remove support for hex number from is_numeric_string 2015-01-28 22:54:17 +01:00
Nikita Popov
6093c9370b Fix resource leak when casting to string 2015-01-24 23:18:26 +01:00
Xinchen Hui
fc33f52d8c bump year 2015-01-15 23:27:30 +08:00
Dmitry Stogov
90c20b4c24 Fixed typo 2015-01-14 21:09:06 +03:00
Dmitry Stogov
2325758624 Improve "instanceof". Interfaces of the left operand should be checked only if the right operand is interafce itself. 2015-01-14 15:06:26 +03:00
Xinchen Hui
2d8fd4b335 Add hinting 2015-01-12 22:06:40 -05:00