]> granicus.if.org Git - php/commitdiff
MFB "Disabled $GLOBALS' refcount modification"
authorArnaud Le Blanc <lbarnaud@php.net>
Sun, 14 Sep 2008 15:20:16 +0000 (15:20 +0000)
committerArnaud Le Blanc <lbarnaud@php.net>
Sun, 14 Sep 2008 15:20:16 +0000 (15:20 +0000)
Zend/zend_gc.c

index 7892c6d027aabe23f281460833167c8d5e4f8adb..8571cd7b667e941604b6a6b5402c49d0cf649fd9 100644 (file)
@@ -302,7 +302,9 @@ static void zval_scan_black(zval *pz TSRMLS_DC)
 
 static int children_scan_black(zval **pz TSRMLS_DC)
 {
-       (*pz)->refcount__gc++;
+       if (Z_TYPE_PP(pz) != IS_ARRAY || Z_ARRVAL_PP(pz) != &EG(symbol_table)) {
+               (*pz)->refcount__gc++;
+       }
 
        if (GC_ZVAL_GET_COLOR(*pz) != GC_BLACK) {
                zval_scan_black(*pz TSRMLS_CC);
@@ -346,7 +348,9 @@ static void zval_mark_grey(zval *pz TSRMLS_DC)
 
 static int children_mark_grey(zval **pz TSRMLS_DC)
 {
-       (*pz)->refcount__gc--;
+       if (Z_TYPE_PP(pz) != IS_ARRAY || Z_ARRVAL_PP(pz) != &EG(symbol_table)) {
+               (*pz)->refcount__gc--;
+       }
        zval_mark_grey(*pz TSRMLS_CC);
        return 0;
 }