mirror of
https://github.com/php/php-src.git
synced 2024-09-23 02:47:26 +00:00
Fixed yet another object aliasing problem
This commit is contained in:
parent
63b93b4a74
commit
86dd321c0c
@ -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;
|
||||
|
22
ext/opcache/tests/opt/sccp_020.phpt
Normal file
22
ext/opcache/tests/opt/sccp_020.phpt
Normal 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
|
Loading…
Reference in New Issue
Block a user