Skip to content

Commit 75bd92a

Browse files
committed
Fixed use-def chain unlinking for "$a = 1; $a += $a;"
1 parent 7d77468 commit 75bd92a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ext/opcache/Optimizer/sccp.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1367,7 +1367,9 @@ static int replace_constant_operands(sccp_ctx *ctx) {
13671367
if (opline->op2_type == IS_CONST) {
13681368
literal_dtor(&ZEND_OP2_LITERAL(opline));
13691369
} else if (ssa_op->op2_use >= 0) {
1370-
zend_ssa_unlink_use_chain(ssa, var->definition, ssa_op->op2_use);
1370+
if (ssa_op->op2_use != ssa_op->op1_use) {
1371+
zend_ssa_unlink_use_chain(ssa, var->definition, ssa_op->op2_use);
1372+
}
13711373
ssa_op->op2_use = -1;
13721374
ssa_op->op2_use_chain = -1;
13731375
}

0 commit comments

Comments
 (0)