com php-src: Arguments array can't make cycles: Zend/tests/bug70805.phpt Zend/tests/bug70805_1.phpt Zend/tests/bug7 0805_2.phpt main/php_variables.c

[email protected] (Dmitry Stogov)
Newsgroups php.cvs
Message-ID <[email protected]>
Commit:    7aff166e5703d53a0d82d267f5401ace31d1a828
Author:    Dmitry Stogov <[email protected]>         Fri, 3 Feb 2017 17:38:03 +0300
Parents:   984a6312e432f1cc32b53bed324c9b0ef16edb45
Branches:  master

Link:       http://git.php.net/?p=php-src.git;a=commitdiff;h=7aff166e5703d53a0d82d267f5401ace31d1a828

Log:
Arguments array can't make cycles

Changed paths:
  M  Zend/tests/bug70805.phpt
  M  Zend/tests/bug70805_1.phpt
  M  Zend/tests/bug70805_2.phpt
  M  main/php_variables.c


Diff:
diff --git a/Zend/tests/bug70805.phpt b/Zend/tests/bug70805.phpt
index 256f52e..ec835bc 100644
--- a/Zend/tests/bug70805.phpt
+++ b/Zend/tests/bug70805.phpt
@@ -27,7 +27,7 @@ $c = new A;
 $array = array($c); //This is used to leave a room for $GLOBALS["a"]
 unset($c);
 
-while ($i++ < 9997) {
+while ($i++ < 9998) {
 	$t = [];
 	$t[] = &$t;
 	unset($t);
diff --git a/Zend/tests/bug70805_1.phpt b/Zend/tests/bug70805_1.phpt
index af57cdb..5159566 100644
--- a/Zend/tests/bug70805_1.phpt
+++ b/Zend/tests/bug70805_1.phpt
@@ -29,7 +29,7 @@ $c = new A;
 $array = array($c); 
 unset($c);
 
-while ($i++ < 9997) {
+while ($i++ < 9998) {
 	$t = [];
 	$t[] = &$t;
 	unset($t);
diff --git a/Zend/tests/bug70805_2.phpt b/Zend/tests/bug70805_2.phpt
index c878c83..a4d01aa 100644
--- a/Zend/tests/bug70805_2.phpt
+++ b/Zend/tests/bug70805_2.phpt
@@ -24,7 +24,7 @@ $a->b->a = $a;
 
 $i = 0;
 
-while ($i++ < 9998) {
+while ($i++ < 9999) {
 	$t = [];
 	$t[] = &$t;
 	unset($t);
diff --git a/main/php_variables.c b/main/php_variables.c
index c1fb36d..7dd5298 100644
--- a/main/php_variables.c
+++ b/main/php_variables.c
@@ -610,7 +610,7 @@ PHPAPI void php_build_argv(char *s, zval *track_vars_array)
 		zend_hash_str_update(Z_ARRVAL_P(track_vars_array), "argv", sizeof("argv")-1, &arr);
 		zend_hash_str_update(Z_ARRVAL_P(track_vars_array), "argc", sizeof("argc")-1, &argc);
 	}
-	zval_ptr_dtor(&arr);
+	zval_ptr_dtor_nogc(&arr);
 }
 /* }}} */
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.