Skip to content

Commit 8e8c5a7

Browse files
committed
Fixed tracing JIT register allocator (failure on ext/opcache/tests/jit/assign_002.phpt)
1 parent dc7a0fb commit 8e8c5a7

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

ext/opcache/jit/zend_jit_trace.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2006,9 +2006,18 @@ static zend_lifetime_interval** zend_jit_trace_allocate_registers(zend_jit_trace
20062006
&& (ssa->vars[ssa_op->result_def].use_chain >= 0
20072007
|| ssa->vars[ssa_op->result_def].phi_use_chain)
20082008
&& zend_jit_var_supports_reg(ssa, ssa_op->result_def)) {
2009-
start[ssa_op->result_def] = idx;
2010-
vars_op_array[ssa_op->result_def] = op_array;
2011-
count++;
2009+
if (!(ssa->var_info[ssa_op->result_def].type & MAY_BE_GUARD)
2010+
|| opline->opcode == ZEND_PRE_INC
2011+
|| opline->opcode == ZEND_PRE_DEC
2012+
|| opline->opcode == ZEND_POST_INC
2013+
|| opline->opcode == ZEND_POST_DEC
2014+
|| opline->opcode == ZEND_ADD
2015+
|| opline->opcode == ZEND_SUB
2016+
|| opline->opcode == ZEND_MUL) {
2017+
start[ssa_op->result_def] = idx;
2018+
vars_op_array[ssa_op->result_def] = op_array;
2019+
count++;
2020+
}
20122021
}
20132022
if (ssa_op->op1_def >= 0
20142023
&& (ssa->vars[ssa_op->op1_def].use_chain >= 0

0 commit comments

Comments
 (0)