com php-src: Merge branch 'PHP-7.4': Zend/zend_gc.c
| From: | Dmitry Stogov | Date: | Thu, 07 Mar 2019 10:58:42 +0000 |
| Subject: | com php-src: Merge branch 'PHP-7.4': Zend/zend_gc.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-105042@lists.php.net to get a copy of this message | ||
Commit: 24378d1809bee78a17970720c368a12887f6df69
Author: Dmitry Stogov <dmitry@zend.com> Thu, 7 Mar 2019 13:58:42 +0300
Parents: e8d313f36fef13173cafd62405e81fa02e7c5484 2f2d15791abaf5ce882c2543227a30d176f3261f
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=24378d1809bee78a17970720c368a12887f6df69
Log:
Merge branch 'PHP-7.4'
* PHP-7.4:
Fixed bug #77345 (Stack Overflow caused by circular reference in garbage collection)
Add support for MemorySanitizer
Bugs:
https://bugs.php.net/77345
Changed paths:
MM Zend/zend_gc.c
Diff:
diff --cc Zend/zend_gc.c
index 499809a,2b39030..fbb636d
--- a/Zend/zend_gc.c
+++ b/Zend/zend_gc.c
@@@ -622,13 -687,15 +687,13 @@@ tail_call
if (EXPECTED(!(OBJ_FLAGS(ref) & IS_OBJ_FREE_CALLED))) {
int n;
zval *zv, *end;
- zval tmp;
- ZVAL_OBJ(&tmp, obj);
- ht = obj->handlers->get_gc(&tmp, &zv, &n);
+ ht = obj->handlers->get_gc(obj, &zv, &n);
end = zv + n;
if (EXPECTED(!ht)) {
- if (!n) return;
+ if (!n) goto next;
while (!Z_REFCOUNTED_P(--end)) {
- if (zv == end) return;
+ if (zv == end) goto next;
}
}
while (zv != end) {
@@@ -728,13 -804,15 +802,13 @@@ static void gc_mark_grey(zend_refcounte
if (EXPECTED(!(OBJ_FLAGS(ref) & IS_OBJ_FREE_CALLED))) {
int n;
zval *zv, *end;
- zval tmp;
- ZVAL_OBJ(&tmp, obj);
- ht = obj->handlers->get_gc(&tmp, &zv, &n);
+ ht = obj->handlers->get_gc(obj, &zv, &n);
end = zv + n;
if (EXPECTED(!ht)) {
- if (!n) return;
+ if (!n) goto next;
while (!Z_REFCOUNTED_P(--end)) {
- if (zv == end) return;
+ if (zv == end) goto next;
}
}
while (zv != end) {
@@@ -880,13 -987,15 +983,13 @@@ tail_call
if (EXPECTED(!(OBJ_FLAGS(ref) & IS_OBJ_FREE_CALLED))) {
int n;
zval *zv, *end;
- zval tmp;
- ZVAL_OBJ(&tmp, obj);
- ht = obj->handlers->get_gc(&tmp, &zv, &n);
+ ht = obj->handlers->get_gc(obj, &zv, &n);
end = zv + n;
if (EXPECTED(!ht)) {
- if (!n) return;
+ if (!n) goto next;
while (!Z_REFCOUNTED_P(--end)) {
- if (zv == end) return;
+ if (zv == end) goto next;
}
}
while (zv != end) {
@@@ -1025,10 -1157,11 +1150,10 @@@ static int gc_collect_white(zend_refcou
obj->ce->destructor != NULL) {
*flags |= GC_HAS_DESTRUCTORS;
}
- ZVAL_OBJ(&tmp, obj);
- ht = obj->handlers->get_gc(&tmp, &zv, &n);
+ ht = obj->handlers->get_gc(obj, &zv, &n);
end = zv + n;
if (EXPECTED(!ht)) {
- if (!n) return count;
+ if (!n) goto next;
while (!Z_REFCOUNTED_P(--end)) {
/* count non-refcounted for compatibility ??? */
if (Z_TYPE_P(zv) != IS_UNDEF) {