Commit Graph

11088 Commits

Author SHA1 Message Date
Dmitry Stogov
eb32da13cd Fix frequent reallocations with many small strings 2015-10-27 17:07:58 +01:00
Dmitry Stogov
0172f198e3 Fixed inconsistent exception handling (uopz/tests/006.phpt was failed when PHP build with --disable-gcc-global-regs). 2015-10-26 16:01:20 +03:00
Xinchen Hui
5767f2b648 Fixed bug #70785 (Infinite loop due to exception during identical comparison) 2015-10-26 11:15:17 +08:00
Bob Weinand
ac58d21aa3 Fix refcount reaching 2^32 - 1 for resources
Happens e.g. in proc_close() when nothing is referencing the file handles, e.g. they have refcount 0 when passed to zend_list_close() and then zend_list_delete() which decrements it to (uint32_t) -1
2015-10-25 18:47:50 +01:00
Nikita Popov
b9cc3176eb Fix bug #70782 2015-10-24 23:19:02 +02:00
Xinchen Hui
6ad2c3eb33 Revert "Ensure proper exception handling and EX(opline) state in USER_OPCODE handler"
read: http://news.php.net/php.internals/88887

This reverts commit 808f62bb4d.
2015-10-20 08:12:04 -07:00
Xinchen Hui
673ad62eed Regenerate zend_ini_scanner.c 2015-10-20 16:58:30 +08:00
Xinchen Hui
c7cb40353c Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	Zend/zend_ini_scanner.c
2015-10-20 13:26:02 +08:00
Xinchen Hui
d5f76caf6c Fixed bug #70748 (Segfault in ini_lex () at Zend/zend_ini_scanner.l) 2015-10-20 13:20:56 +08:00
Aaron Piotrowski
c100a742dc Fix missed assertion tests 2015-10-18 02:23:43 -05:00
Nikita Popov
e3e92e96c1 Fixed bug #70430 2015-10-15 22:14:23 +02:00
Nikita Popov
06f38d36a8 Reindent zend_yytnamerr
Separating this whitespace change from the next diff.
2015-10-15 22:13:14 +02:00
Bob Weinand
60b4355168 Do not create a fake Closure for real Closures
That is solved by just returning the Closure as is, which is safe due to Closures being immutable objects
2015-10-14 12:07:33 +02:00
Dmitry Stogov
d949c3b6e5 Fixed incorrect "peak" memory consumption calculation. 2015-10-13 15:20:17 +03:00
Xinchen Hui
a8ae88162f Fixed bug #70689 (Exception handler does not work as expected) 2015-10-13 17:40:58 +08:00
Nikita Popov
7597a06562 Add more tests for closure binding 2015-10-12 20:37:14 +02:00
Dmitry Stogov
23b372d358 Forbid "fake" closure rebinding 2015-10-12 20:34:08 +02:00
Anatol Belski
dcbbf7c38d increase API versions 2015-10-12 20:17:22 +02:00
Xinchen Hui
8732ead953 Double declaration 2015-10-12 10:42:04 +08:00
Nikita Popov
c85ad5d0be Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	Zend/zend_closures.c
2015-10-10 15:00:41 +02:00
Nikita Popov
d7d01fc9a3 Fixed bug #70685
Doing a less intrusive variant of the PHP 7.0 fix for 5.6.
2015-10-10 14:59:21 +02:00
Nikita Popov
4b821f0fc6 Normalize rebinding failures
Move all rebinding checks into one function to make sure they stay
in sync. Normalize return value to be NULL for all rebinding
failures, instead of returning an improperly bound closure in some
cases.
2015-10-10 13:56:36 +02:00
Nikita Popov
d677b25b1c Merge branch 'PHP-5.6' into PHP-7.0 2015-10-09 23:28:58 +02:00
Nikita Popov
e19423f3cb Improve previous fix
Don't forbid null binding on plain functions.
2015-10-09 23:28:24 +02:00
Nikita Popov
f6ae19f158 Merge branch 'PHP-5.6' into PHP-7.0 2015-10-09 23:06:32 +02:00
Nikita Popov
bbae7ddf29 Fixed bug #70681 2015-10-09 23:01:23 +02:00
Dmitry Stogov
0847681b1a Fixed bug #70630 (Closure::call/bind() crash with ReflectionFunction->getClosure()) 2015-10-09 11:48:13 +03:00
Dmitry Stogov
c6af0aa33f Fixed reference cuntmting for closures (previously we didn't increment reference counter for "internal" closures) 2015-10-09 02:39:07 +03:00
Dmitry Stogov
93748bf9dd Fixed infinity recurion if we create closure on top of other closure. 2015-10-09 02:37:51 +03:00
Dmitry Stogov
05bd331c6a Fixed use after free 2015-10-09 01:09:22 +03:00
Dmitry Stogov
91fb3a7b27 Fixed bug #70674 (ReflectionFunction::getClosure() leaks memory when used for internal functions) 2015-10-09 00:45:02 +03:00
Nikita Popov
cc3c425af8 Fix bug #70662
This replaces add_new with update for the RW case. This should not
be problematic for performance, as this branch throws a notice.

Alternatively add_new could also be replaced with add. I went with
update, because it makes $a[0] += 1 behavior the same as
$a[0] = $a[0] + 1.
2015-10-08 11:03:39 +02:00
Márcio Almada
ddb6d7801e Fix bug #70650 2015-10-07 16:25:59 +02:00
Dmitry Stogov
b8b335c492 Restored the original (php-5) behavior of convert_to_cstring(). It was broken in php7 by mistake and caused problems in ext/pgsql/tests/bug46408.phpt. 2015-10-07 04:26:26 +03:00
Dmitry Stogov
e0b3b3c752 Revert "Fixed bug #70630 (Closure::call/bind() crash with ReflectionFunction->getClosure())"
This reverts commit 517b553625.
2015-10-06 23:59:36 +03:00
Dmitry Stogov
e193d35c1e Revert "Improve 517b55362 (scope rebinding on method Closures)"
This reverts commit 881c502520.
2015-10-06 23:48:15 +03:00
Dmitry Stogov
24e88348f3 Revert "Merge branch 'array_keys_strict_refs' of https://github.com/tony2001/php-src"
This reverts commit a6be0f3fd6.
2015-10-06 23:48:12 +03:00
Dmitry Stogov
524d00e005 Revert "Allow random $this on non-internal Closures again"
This reverts commit 35d0405c47.
2015-10-06 23:48:10 +03:00
Dmitry Stogov
3c0348056a Revert "Speed up self::method() calls (no ZEND_FETCH_CLASS)"
This reverts commit 8c33bdb976.
2015-10-06 23:48:08 +03:00
Dmitry Stogov
5a49ac77aa Revert "Speed up self::$property access by 20%"
This reverts commit 0fbd3e5fe7.
2015-10-06 23:48:04 +03:00
Rasmus Lerdorf
fb2c890c2c zend.assertions is not a boolean 2015-10-06 17:13:38 +09:00
Bob Weinand
0fbd3e5fe7 Speed up self::$property access by 20% 2015-10-05 21:52:09 +02:00
Bob Weinand
8c33bdb976 Speed up self::method() calls (no ZEND_FETCH_CLASS) 2015-10-05 21:16:52 +02:00
Bob Weinand
35d0405c47 Allow random $this on non-internal Closures again
As it turns out, there is actually no reason to prevent this, it even was a bigger BC break than expected...

Also fixes a memory leak (the Closure leaks) when calling internal functions via Closure by moving it out of leave helper onto caller side for TOP_CODE:

$z = new SplStack; $z->push(20);
$x = (new ReflectionMethod("SplStack", "pop"))->getClosure($z);
var_dump($x());
2015-10-05 17:49:32 +02:00
Bob Weinand
a6be0f3fd6 Merge branch 'array_keys_strict_refs' of https://github.com/tony2001/php-src 2015-10-05 14:50:04 +02:00
Bob Weinand
881c502520 Improve 517b55362 (scope rebinding on method Closures)
Now it is completely impossible to rebind a scoped method Closure (only the kind you get from ReflectionMethod::getClosure()) to a foreign scope
Adding a lot of tests to ensure this...
Also, properly return NULL in case the Closure could not be created instead of some crippled unbound Closure
2015-10-05 00:56:55 +02:00
Xinchen Hui
2fb8bb1157 Fixed bug #70632 (Third one of segfault in gc_remove_from_buffer) 2015-10-03 20:33:24 -07:00
Bob Weinand
517b553625 Fixed bug #70630 (Closure::call/bind() crash with ReflectionFunction->getClosure())
This additionally removes support for binding to an unknown (not in parent hierarchy) scope.
Removing support for cross-scope is necessary for certain compile-time assumptions (like class constants) to prevent unexpected results
2015-10-04 01:38:59 +02:00
Bob Weinand
6c61286da4 Do not include zend_verify_return_type in executable ops (phpdbg) 2015-10-02 12:37:39 +02:00
Nikita Popov
8557e8323a Remove checks for read_property retval being NULL
read_property uses &EG(uninitialized_zval) instead.
2015-10-01 16:33:30 +02:00