Skip to content

Commit 8c2c5d9

Browse files
committed
Fix may_throw and indirect_reference in tracing JIT
We now may_throw for MAY_BE_FALSE. Also don't set indirect_feference in this case, as we now go through the slow path and the container isn't guaranteed to be in r0/REG0 anymore.
1 parent 827a9df commit 8c2c5d9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/opcache/jit/zend_jit_trace.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5198,7 +5198,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
51985198
op1_info, op1_addr, op2_info, RES_REG_ADDR(),
51995199
(opline->opcode == ZEND_FETCH_DIM_RW
52005200
|| opline->op2_type == IS_UNUSED
5201-
|| (op1_info & (MAY_BE_TRUE|MAY_BE_LONG|MAY_BE_DOUBLE|MAY_BE_STRING|MAY_BE_OBJECT|MAY_BE_RESOURCE|MAY_BE_REF))
5201+
|| (op1_info & (MAY_BE_FALSE|MAY_BE_TRUE|MAY_BE_LONG|MAY_BE_DOUBLE|MAY_BE_STRING|MAY_BE_OBJECT|MAY_BE_RESOURCE|MAY_BE_REF))
52025202
|| (op2_info & (MAY_BE_UNDEF|MAY_BE_RESOURCE|MAY_BE_ARRAY|MAY_BE_OBJECT))
52035203
|| (opline->op1_type == IS_VAR
52045204
&& (op1_info & MAY_BE_UNDEF)
@@ -5207,7 +5207,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
52075207
}
52085208
if (ssa_op->result_def > 0
52095209
&& (opline->opcode == ZEND_FETCH_DIM_W || opline->opcode == ZEND_FETCH_LIST_W)
5210-
&& !(op1_info & (MAY_BE_TRUE|MAY_BE_LONG|MAY_BE_DOUBLE|MAY_BE_STRING|MAY_BE_OBJECT|MAY_BE_RESOURCE|MAY_BE_REF))
5210+
&& !(op1_info & (MAY_BE_FALSE|MAY_BE_TRUE|MAY_BE_LONG|MAY_BE_DOUBLE|MAY_BE_STRING|MAY_BE_OBJECT|MAY_BE_RESOURCE|MAY_BE_REF))
52115211
&& !(op2_info & (MAY_BE_UNDEF|MAY_BE_RESOURCE|MAY_BE_ARRAY|MAY_BE_OBJECT))) {
52125212
ssa->var_info[ssa_op->result_def].indirect_reference = 1;
52135213
}

0 commit comments

Comments
 (0)