Fixed yet another object aliasing problem

This commit is contained in:
Dmitry Stogov 2017-09-11 23:19:03 +03:00
parent 63b93b4a74
commit 86dd321c0c
2 changed files with 23 additions and 1 deletions

View File

@ -285,7 +285,7 @@ static int is_escape_use(zend_op_array *op_array, zend_ssa *ssa, int use, int va
/* reference dependencies processed separately */
break;
case ZEND_ASSIGN:
if (opline->op2_type == IS_CV) {
if (opline->op2_type == IS_CV || opline->result_type != IS_UNUSED) {
if (OP2_INFO() & MAY_BE_OBJECT) {
/* object aliasing */
return 1;

View File

@ -0,0 +1,22 @@
--TEST--
SCCP 020: Object assignemnt
--INI--
opcache.enable=1
opcache.enable_cli=1
opcache.optimization_level=-1
;opcache.opt_debug_level=0x20000
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
function foo() {
$b = $a = new stdClass;
$a->x = 5;
$b->x = 42;
echo $a->x;
echo "\n";
}
foo();
?>
--EXPECT--
42