Don't def non-cv variables in assign_obj_ref data operand.
This commit is contained in:
Nikita Popov 2019-05-22 09:34:35 +02:00
parent d6c0c5ef8e
commit ff4b0ce0e8
2 changed files with 23 additions and 2 deletions

View File

@ -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 {

View File

@ -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===