diff --git a/ext/opcache/jit/zend_jit_trace.c b/ext/opcache/jit/zend_jit_trace.c index 41136bcd8051..450301f92b15 100644 --- a/ext/opcache/jit/zend_jit_trace.c +++ b/ext/opcache/jit/zend_jit_trace.c @@ -6874,7 +6874,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par ssa->var_info[j].type &= ~MAY_BE_GUARD; op_type = concrete_type(ssa->var_info[j].type); - if (!zend_jit_type_guard(&ctx, NULL, EX_NUM_TO_VAR(i), op_type)) { + if (!zend_jit_type_guard(&ctx, (p+1)->opline, EX_NUM_TO_VAR(i), op_type)) { goto jit_failure; } SET_STACK_TYPE(stack, i, op_type, 1); diff --git a/ext/opcache/tests/jit/gh24389.phpt b/ext/opcache/tests/jit/gh24389.phpt new file mode 100644 index 000000000000..8c8d5725f614 --- /dev/null +++ b/ext/opcache/tests/jit/gh24389.phpt @@ -0,0 +1,30 @@ +--TEST-- +GH-24389 (Tracing JIT: type guard on entry of an inlined call exits with an uninitialized opline) +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +opcache.file_update_protection=0 +opcache.jit_buffer_size=64M +opcache.jit=tracing +--EXTENSIONS-- +opcache +--FILE-- + +--EXPECT-- +int(1) +float(1)