Skip to content

Commit 4bd5650

Browse files
committed
IR JIT: Fixed phpGH-11127 (JIT fault)
1 parent 3950ee2 commit 4bd5650

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

ext/opcache/jit/zend_jit_ir.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8094,7 +8094,15 @@ static int zend_jit_init_fcall(zend_jit_ctx *jit, const zend_op *opline, uint32_
80948094
// JIT: if (CACHED_PTR(opline->result.num))
80958095
cache_slot_ref = ir_ADD_OFFSET(ir_LOAD_A(jit_EX(run_time_cache)), opline->result.num);
80968096
func_ref = ir_LOAD_A(cache_slot_ref);
8097-
if_func = ir_IF(func_ref);
8097+
if (JIT_G(trigger) == ZEND_JIT_ON_HOT_TRACE
8098+
&& func
8099+
&& (func->common.fn_flags & ZEND_ACC_IMMUTABLE)
8100+
&& opline->opcode != ZEND_INIT_FCALL) {
8101+
/* Called func may be changed because of recompilation. See ext/opcache/tests/jit/init_fcall_003.phpt */
8102+
if_func = ir_IF(ir_EQ(func_ref, ir_CONST_ADDR(func)));
8103+
} else {
8104+
if_func = ir_IF(func_ref);
8105+
}
80988106
ir_IF_FALSE_cold(if_func);
80998107
if (opline->opcode == ZEND_INIT_FCALL
81008108
&& func

0 commit comments

Comments
 (0)