com php-src: Fixed bug #76446 (zend_variables.c:73 : zend_string_destroy: Assertion `!(zval_gc _flags((str)->gc)).: NEWS ext/opcache/Opt imizer/dce.c
ext/opcache/tests/bug76446.phpt
| From: | Xinchen Hui | Date: | Wed, 13 Jun 2018 07:06:51 +0000 |
| Subject: | com php-src: Fixed bug #76446 (zend_variables.c:73 : zend_string_destroy: Assertion `!(zval_gc _flags((str)->gc)).: NEWS ext/opcache/Opt imizer/dce.c ext/opcache/tests/bug76446.phpt |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-102138@lists.php.net to get a copy of this message | ||
Commit: 609385bbf8fc82f334778bdfef5e16b7a3bd72c6
Author: Xinchen Hui <laruence@gmail.com> Wed, 13 Jun 2018 15:06:51 +0800
Parents: 1650e4669d5a84a0aeea9ad64cdaa410e12ca1e3
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=609385bbf8fc82f334778bdfef5e16b7a3bd72c6
Log:
Fixed bug #76446 (zend_variables.c:73: zend_string_destroy: Assertion
`!(zval_gc_flags((str)->gc)).
Bugs:
https://bugs.php.net/76446
Changed paths:
M NEWS
M ext/opcache/Optimizer/dce.c
A ext/opcache/tests/bug76446.phpt
Diff:
diff --git a/NEWS b/NEWS
index 13453f5..3b2ca43 100644
--- a/NEWS
+++ b/NEWS
@@ -17,6 +17,8 @@ PHP NEWS
- Opcache:
. Fixed bug #76463 (var has array key type but not value type). (Laruence)
+ . Fixed bug #76446 (zend_variables.c:73: zend_string_destroy: Assertion
+ `!(zval_gc_flags((str)->gc)). (Nikita, Laruence)
- ZIP:
. Fixed bug #76461 (OPSYS_Z_CPM defined instead of OPSYS_CPM).
diff --git a/ext/opcache/Optimizer/dce.c b/ext/opcache/Optimizer/dce.c
index 4a35c9e..5892597 100644
--- a/ext/opcache/Optimizer/dce.c
+++ b/ext/opcache/Optimizer/dce.c
@@ -39,7 +39,7 @@
* postdominator tree and of postdominance frontiers, which does not seem worthwhile at this
* point.
* * We separate intrinsic side-effects from potential side-effects in the form of notices thrown
- * by the instruction (in case we want to make this configurable). See may_have_side_effect()
and
+ * by the instruction (in case we want to make this configurable). See may_have_side_effects()
and
* zend_may_throw().
* * We often cannot DCE assignments and unsets while guaranteeing that dtors run in the same
* order. There is an optimization option to allow reordering of dtor effects.
@@ -109,7 +109,6 @@ static inline zend_bool may_have_side_effects(
case ZEND_CAST:
case ZEND_ROPE_INIT:
case ZEND_ROPE_ADD:
- case ZEND_ROPE_END:
case ZEND_INIT_ARRAY:
case ZEND_ADD_ARRAY_ELEMENT:
case ZEND_SPACESHIP:
@@ -127,6 +126,9 @@ static inline zend_bool may_have_side_effects(
case ZEND_FUNC_GET_ARGS:
/* No side effects */
return 0;
+ case ZEND_ROPE_END:
+ /* TODO: Rope dce optmization, see #76446 */
+ return 1;
case ZEND_JMP:
case ZEND_JMPZ:
case ZEND_JMPNZ:
diff --git a/ext/opcache/tests/bug76446.phpt b/ext/opcache/tests/bug76446.phpt
new file mode 100644
index 0000000..dfb676f
--- /dev/null
+++ b/ext/opcache/tests/bug76446.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Bug #76446 (zend_variables.c:73: zend_string_destroy: Assertion `!(zval_gc_flags((str)->gc)
+--INI--
+opcache.enable=1
+opcache.enable_cli=1
+opcache.optimization_level=-1
+--SKIPIF--
+<?php require_once('skipif..inc'); ?>
+--FILE--
+<?php
+function test()
+{
+ $openmenu = '';
+ $openstr2 = "&openmenu={$openmenu}{$addlang}\"";
+ return 0;
+}
+
+var_dump(test());
+?>
+--EXPECTF--
+Notice: Undefined variable: addlang in %sbug76446.php on line %d
+int(0)