Skip to content

Commit 4736bdc

Browse files
committed
Merge branch 'master' into jit-dynasm
* master: Fixed yet another object aliasing problem
2 parents 11dc911 + 86dd321 commit 4736bdc

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

ext/opcache/Optimizer/escape_analysis.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ static int is_escape_use(zend_op_array *op_array, zend_ssa *ssa, int use, int va
285285
/* reference dependencies processed separately */
286286
break;
287287
case ZEND_ASSIGN:
288-
if (opline->op2_type == IS_CV) {
288+
if (opline->op2_type == IS_CV || opline->result_type != IS_UNUSED) {
289289
if (OP2_INFO() & MAY_BE_OBJECT) {
290290
/* object aliasing */
291291
return 1;
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
--TEST--
2+
SCCP 020: Object assignemnt
3+
--INI--
4+
opcache.enable=1
5+
opcache.enable_cli=1
6+
opcache.optimization_level=-1
7+
;opcache.opt_debug_level=0x20000
8+
--SKIPIF--
9+
<?php require_once('skipif.inc'); ?>
10+
--FILE--
11+
<?php
12+
function foo() {
13+
$b = $a = new stdClass;
14+
$a->x = 5;
15+
$b->x = 42;
16+
echo $a->x;
17+
echo "\n";
18+
}
19+
foo();
20+
?>
21+
--EXPECT--
22+
42

0 commit comments

Comments
 (0)