diff --git a/ext/opcache/jit/zend_jit_internal.h b/ext/opcache/jit/zend_jit_internal.h index 1b6f88ead01..a00398e726d 100644 --- a/ext/opcache/jit/zend_jit_internal.h +++ b/ext/opcache/jit/zend_jit_internal.h @@ -562,6 +562,9 @@ typedef union _zend_jit_trace_stack { (_stack)[_slot].reg = _reg; \ (_stack)[_slot].flags = _flags; \ } while (0) +#define RESET_STACK_MEM_TYPE(_stack, _slot) do { \ + (_stack)[_slot].mem_type = IS_UNKNOWN; \ + } while (0) /* trace info flags */ #define ZEND_JIT_TRACE_CHECK_INTERRUPT (1<<0) diff --git a/ext/opcache/jit/zend_jit_trace.c b/ext/opcache/jit/zend_jit_trace.c index ad19722dead..c19257e2760 100644 --- a/ext/opcache/jit/zend_jit_trace.c +++ b/ext/opcache/jit/zend_jit_trace.c @@ -6229,6 +6229,9 @@ done: } else { SET_STACK_TYPE(stack, EX_VAR_TO_NUM(opline->result.var), type, (type == IS_UNKNOWN || !ra || !ra[ssa_op->result_def])); + if (ssa->var_info[ssa_op->result_def].type & MAY_BE_INDIRECT) { + RESET_STACK_MEM_TYPE(stack, EX_VAR_TO_NUM(opline->result.var)); + } if (type != IS_UNKNOWN) { ssa->var_info[ssa_op->result_def].type &= ~MAY_BE_GUARD; if (opline->opcode == ZEND_FETCH_THIS diff --git a/ext/opcache/tests/jit/fetch_dim_r_014.phpt b/ext/opcache/tests/jit/fetch_dim_r_014.phpt new file mode 100644 index 00000000000..e910f11166a --- /dev/null +++ b/ext/opcache/tests/jit/fetch_dim_r_014.phpt @@ -0,0 +1,19 @@ +--TEST-- +JIT FETCH_DIM_R: 014 +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +opcache.file_update_protection=0 +opcache.jit_buffer_size=1M +--FILE-- + +DONE +--EXPECT-- +DONE