com php-src: Fix bug #78034: ext/opcache/Optimizer/zend_dfg .c ext/opcache/tests/bug78034.phpt
| From: | Nikita Popov | Date: | Wed, 22 May 2019 07:35:38 +0000 |
| Subject: | com php-src: Fix bug #78034: ext/opcache/Optimizer/zend_dfg .c ext/opcache/tests/bug78034.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-106283@lists.php.net to get a copy of this message | ||
Commit: ff4b0ce0e8d582e4b8f6c44270a77f511d28bacd
Author: Nikita Popov <nikita.ppv@gmail.com> Wed, 22 May 2019 09:34:35 +0200
Parents: d6c0c5ef8e90b26b8cf1632be1baa379405d0ba9
Branches: PHP-7.4 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ff4b0ce0e8d582e4b8f6c44270a77f511d28bacd
Log:
Fix bug #78034
Don't def non-cv variables in assign_obj_ref data operand.
Bugs:
https://bugs.php.net/78034
Changed paths:
M ext/opcache/Optimizer/zend_dfg.c
A ext/opcache/tests/bug78034.phpt
Diff:
diff --git a/ext/opcache/Optimizer/zend_dfg.c b/ext/opcache/Optimizer/zend_dfg.c
index 00a7dba..a110461 100644
--- a/ext/opcache/Optimizer/zend_dfg.c
+++ b/ext/opcache/Optimizer/zend_dfg.c
@@ -52,8 +52,8 @@ int zend_build_dfg(const zend_op_array *op_array, const zend_cfg *cfg, zend_dfg
if (next < end && next->opcode == ZEND_OP_DATA) {
if (next->op1_type & (IS_CV|IS_VAR|IS_TMP_VAR)) {
var_num = EX_VAR_TO_NUM(next->op1.var);
- if (opline->opcode == ZEND_ASSIGN_OBJ_REF
- || opline->opcode == ZEND_ASSIGN_STATIC_PROP_REF) {
+ if (next->op1_type == IS_CV && (opline->opcode == ZEND_ASSIGN_OBJ_REF
+ || opline->opcode == ZEND_ASSIGN_STATIC_PROP_REF)) {
DFG_SET(use, set_size, j, var_num);
DFG_SET(def, set_size, j, var_num);
} else {
diff --git a/ext/opcache/tests/bug78034.phpt b/ext/opcache/tests/bug78034.phpt
new file mode 100644
index 0000000..ca9cd4e
--- /dev/null
+++ b/ext/opcache/tests/bug78034.phpt
@@ -0,0 +1,21 @@
+--TEST--
+Bug #78034: "pecl" tool fails with abort assertion in zend_ssa.c
+--FILE--
+<?php
+
+function &ref() {}
+
+class Test {
+ function method($bool) {
+ if (!$bool) {
+ $this->foo = &ref();
+ }
+
+ $this->foo = &ref();
+ }
+}
+
+?>
+===DONE===
+--EXPECT--
+===DONE===