Skip to content

Commit 30cf0a0

Browse files
committed
Avoid register allocation for ASSIGN into aliased variable (it might be indirectly changed into IS_REFERENCE)
1 parent 8b265fb commit 30cf0a0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

ext/opcache/jit/zend_jit_trace.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2211,6 +2211,15 @@ static zend_lifetime_interval** zend_jit_trace_allocate_registers(zend_jit_trace
22112211

22122212
support_opline =
22132213
zend_jit_opline_supports_reg(op_array, ssa, opline, ssa_op, p);
2214+
2215+
if (support_opline
2216+
&& opline->opcode == ZEND_ASSIGN
2217+
&& opline->op1_type == IS_CV
2218+
&& zend_jit_var_may_alias(op_array, op_array_ssa, EX_VAR_TO_NUM(opline->op1.var)) != NO_ALIAS) {
2219+
/* avoid register allocation in case of possiblity of indirect modification*/
2220+
support_opline = 0;
2221+
}
2222+
22142223
if (ssa_op->op1_use >= 0
22152224
&& start[ssa_op->op1_use] >= 0
22162225
&& !zend_ssa_is_no_val_use(opline, ssa_op, ssa_op->op1_use)) {

0 commit comments

Comments
 (0)