Commit Graph

248 Commits

Author SHA1 Message Date
Nikita Popov
43417953f4 Remove redundant Generator::__wakeup() method
Generators already make use of (un)serialize_deny, so there's no
need to additionally have a throwing __wakeup() implementation.
2018-11-26 13:13:26 +01:00
Dmitry Stogov
0f7f1498be Use ZEND_THIS macro to hide implementation details in extensions code. 2018-11-15 19:54:19 +03:00
Dmitry Stogov
c6ad0b92b7 Replace getThis() by EX(This), when additional check is not necessary. 2018-11-14 02:44:25 +03:00
Nikita Popov
7189e0b70f Merge branch 'PHP-7.2' into PHP-7.3 2018-09-28 19:17:53 +02:00
Nikita Popov
8e7dfc6ddf Merge branch 'PHP-7.1' into PHP-7.2 2018-09-28 19:17:29 +02:00
Nikita Popov
83e2b9e220 Fixed bug #76946 2018-09-28 19:15:19 +02:00
Peter Kokot
8d3f8ca12a Remove unused Git attributes ident
The $Id$ keywords were used in Subversion where they can be substituted
with filename, last revision number change, last changed date, and last
user who changed it.

In Git this functionality is different and can be done with Git attribute
ident. These need to be defined manually for each file in the
.gitattributes file and are afterwards replaced with 40-character
hexadecimal blob object name which is based only on the particular file
contents.

This patch simplifies handling of $Id$ keywords by removing them since
they are not used anymore.
2018-07-25 00:53:25 +02:00
Dmitry Stogov
7d4e18b05d Improved user iterator implementation to reduce zend_class_entry memory consumption and avoid race condition during resolving/caching of user iterator functions of internal classes in ZTS build. 2018-07-12 14:04:14 +03:00
Dmitry Stogov
67b4c3379a Uze ZVAL_COPY_DEREF() instead of ZVAL_DEREF() and ZVAL_COPY() 2018-07-09 12:46:46 +03:00
Xinchen Hui
72104d2b6e supplemental fix for bug #76427
there are two parts to make this problem visible , the first is
our new gc new freeing zvals in an opposite direction(compare to 7.2)
the second is zend_object_store_del doesn't check IS_VALID since 7.3
(using assertion instead)
2018-06-12 09:40:34 +08:00
Xinchen Hui
ffaee27478 Fixed bug #76427 (Segfault in zend_objects_store_put) 2018-06-11 21:00:38 +08:00
Dmitry Stogov
f2b4ec4bdc Export standard object handlers, to avoid indirect access 2018-05-31 11:57:22 +03:00
Gabriel Caruso
701437a948
Remove return types from some magic method in protos
__construct, __destruct, __wakeup does not have return types defined.
2018-03-09 12:04:46 +01:00
Dmitry Stogov
5e8aa036f2 Access extra data stored in zval through macros 2018-01-23 12:56:22 +03:00
Dmitry Stogov
d688129360 Removed recursive call 2018-01-16 09:44:49 +03:00
Nikita Popov
6aa045e174 Merge branch 'PHP-7.2' 2018-01-13 11:06:58 +01:00
Nikita Popov
cf70e1910b Merge branch 'PHP-7.1' into PHP-7.2 2018-01-13 11:06:46 +01:00
Nikita Popov
8c07170ddb Fix generator GC if yield from parent chain does not reach root
Parents may be unlinked while another generator sharing part of the
chain is running. As such, we cannot assume that the parent chain
goes all the way to the root. Instead walk backwards from root to
leaf, like we also do during destruction.
2018-01-13 11:04:26 +01:00
Nikita Popov
47e6c1491b Merge branch 'PHP-7.2' 2018-01-12 22:51:29 +01:00
Nikita Popov
d00f52b6a9 Merge branch 'PHP-7.1' into PHP-7.2 2018-01-12 22:51:20 +01:00
Nikita Popov
cab0a814bd Try to fix yield from GC issues
Make sure we always update root and parent references before
releasing the old root object.

This fixes some crashes under aggressive cycle collection, so
hopefully this will also fix bug #75351.
2018-01-12 22:51:03 +01:00
Nikita Popov
d8d20020f5 Merge branch 'PHP-7.2' 2018-01-12 21:28:31 +01:00
Nikita Popov
e112b8474a Merge branch 'PHP-7.1' into PHP-7.2 2018-01-12 21:28:24 +01:00
Nikita Popov
420d11e8ca Fixed bug #75396
Do not run finally blocks in generators on unclean shutdown (e.g.
caused by exit). This is consistent with how finally blocks outside
of generators behave.
2018-01-12 21:27:23 +01:00
Nikita Popov
5fef837c28 Simplify non-linear generator yield from tree
Remove special handling for 2-4 children. Now the three possible
cases are no children, one child, or many children (HT).

The non-linear (many children) case is extremely rare, so there is
no point in trying to optimize it.
2018-01-12 21:14:50 +01:00
Nikita Popov
27f09efa11 Avoid duplicate addition of generators in yield from tree 2018-01-12 18:37:47 +01:00
Dmitry Stogov
12c386f5b9 Use ZEND_CLOSURE_OBJECT() macro to resolve closure op_array to closure object through address calculation, instead of op_array->prototype reuse. (reapply 781e1573af, now it should be OK). 2018-01-11 22:15:45 +03:00
Dmitry Stogov
6ba10a03e7 Revert "Use ZEND_CLOSURE_OBJECT() macro to resolve closure op_array to closure object through address calculation, instead of op_array->prototype reuse." (this patch is incomplete or wrong)
This reverts commit 781e1573af.
2018-01-11 17:27:26 +03:00
Dmitry Stogov
781e1573af Use ZEND_CLOSURE_OBJECT() macro to resolve closure op_array to closure object through address calculation, instead of op_array->prototype reuse. 2018-01-11 16:25:28 +03:00
Xinchen Hui
a6519d0514 year++ 2018-01-02 12:57:58 +08:00
Xinchen Hui
7a7ec01a49 year++ 2018-01-02 12:55:14 +08:00
Xinchen Hui
ccd4716ec7 year++ 2018-01-02 12:53:31 +08:00
Dmitry Stogov
1db8402208 Move zend_object_iterator_funcs structures into read-only data segment 2017-12-14 14:21:22 +03:00
Nikita Popov
7b16205f8b Remove some unnecessary duplications 2017-10-30 22:48:20 +01:00
Dmitry Stogov
49ea143bbd Encapsulate reference-counting primitives.
Prohibit direct update of GC_REFCOUNT(), GC_SET_REFCOUNT(), GC_ADDREF() and GC_DELREF() shoukf be instead.
Added mactros to validate reference-counting (disabled for now).
These macros are going to be used to eliminate race-condintions during reference-counting on data shared between threads.
2017-10-27 01:28:58 +03:00
Bob Weinand
76ce874422 Merge branch 'PHP-7.1' into PHP-7.2 2017-07-22 11:16:48 +02:00
Bob Weinand
134e713be2 Merge branch 'PHP-7.0' into PHP-7.1 2017-07-22 11:14:54 +02:00
Bob Weinand
bad5d0d6c5 Fixed bug #74954 (null deref and segfault in zend_generator_resume()) 2017-07-22 11:14:00 +02:00
Anatol Belski
bc5811f361 further sync for vim mode lines 2017-07-04 18:12:45 +02:00
Bob Weinand
ccb5591728 Merge branch 'PHP-7.1' 2017-05-17 19:59:36 +02:00
Bob Weinand
649494c0ee Fixed bug #74606 (Segfault within try/catch/finally nesting in Generators)
Thanks to Nikita for pointing out the error source.
2017-05-17 19:58:51 +02:00
Sammy Kaye Powers
dac6c639bb Update copyright headers to 2017 2017-01-04 11:23:42 -06:00
Sammy Kaye Powers
478f119ab9 Update copyright headers to 2017 2017-01-04 11:14:55 -06:00
Sammy Kaye Powers
9e29f841ce Update copyright headers to 2017 2017-01-02 09:30:12 -06:00
Dmitry Stogov
fac95658b3 Improved VM stack unwinding on exception.
Now zend_throw_exception_hook() is going to be called only when exception is actually thrown and not going to be recalled for each unwinded finction.
2016-12-12 10:55:32 +03:00
Bob Weinand
ad5038bfee Merge branch 'PHP-7.0' into PHP-7.1 2016-12-01 15:21:49 +01:00
Bob Weinand
fcaccbaa22 Fix valgrind issue when throwing due to yield from aborted generator 2016-12-01 15:21:28 +01:00
Anatol Belski
22a3d55e9a fix exports which are now referenced by phpdbg
(cherry picked from commit cd0f1c8a5e)
2016-09-28 21:29:53 +02:00
Bob Weinand
e5d75d7268 Add phpdbg generator command 2016-09-28 13:26:08 +02:00
Andrea Faulds
fc5497cb92 Merge branch 'PHP-7.0' into PHP-7.1 2016-09-11 22:46:20 +01:00