Skip to content

Commit 0ef8e0c

Browse files
committed
Result of branching opcode in side trace is unknown
1 parent d65d3f5 commit 0ef8e0c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ext/opcache/jit/zend_jit_x86.dasc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3288,6 +3288,7 @@ static int zend_jit_trace_handler(dasm_State **Dst, const zend_op_array *op_arra
32883288
uint32_t exit_point;
32893289
const void *exit_addr;
32903290
uint32_t old_info = 0;
3291+
uint32_t old_res_info = 0;
32913292
zend_jit_trace_stack *stack = JIT_G(current_frame)->stack;
32923293

32933294
if (zend_is_smart_branch(opline)) {
@@ -3326,9 +3327,16 @@ static int zend_jit_trace_handler(dasm_State **Dst, const zend_op_array *op_arra
33263327
}
33273328
}
33283329

3330+
if (opline->result_type == IS_VAR || opline->result_type == IS_TMP_VAR) {
3331+
old_res_info = STACK_INFO(stack, EX_VAR_TO_NUM(opline->result.var));
3332+
SET_STACK_TYPE(stack, EX_VAR_TO_NUM(opline->result.var), IS_UNKNOWN);
3333+
}
33293334
exit_point = zend_jit_trace_get_exit_point(opline, exit_opline, trace, 0);
33303335
exit_addr = zend_jit_trace_get_exit_addr(exit_point);
33313336

3337+
if (opline->result_type == IS_VAR || opline->result_type == IS_TMP_VAR) {
3338+
SET_STACK_INFO(stack, EX_VAR_TO_NUM(opline->result.var), old_res_info);
3339+
}
33323340
switch (opline->opcode) {
33333341
case ZEND_FE_FETCH_R:
33343342
case ZEND_FE_FETCH_RW:

0 commit comments

Comments
 (0)