diff --git a/ext/opcache/jit/zend_jit_trace.c b/ext/opcache/jit/zend_jit_trace.c index 9c54767fc226..4148fa8c5308 100644 --- a/ext/opcache/jit/zend_jit_trace.c +++ b/ext/opcache/jit/zend_jit_trace.c @@ -2357,6 +2357,7 @@ static zend_ssa *zend_jit_trace_build_tssa(zend_jit_trace_rec *trace_buffer, uin /* Add statically inferred restrictions */ if (ssa_ops[idx].op1_def >= 0) { if (opline->opcode == ZEND_SEND_VAR_EX + && opline->op2_type != IS_CONST && frame && frame->call && frame->call->func diff --git a/ext/opcache/tests/jit/gh25359.phpt b/ext/opcache/tests/jit/gh25359.phpt new file mode 100644 index 000000000000..b9c011cea57b --- /dev/null +++ b/ext/opcache/tests/jit/gh25359.phpt @@ -0,0 +1,27 @@ +--TEST-- +GH-25359 (Tracing JIT drops reference type of CV passed as a named by-ref argument) +--EXTENSIONS-- +opcache +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +opcache.jit=tracing +opcache.jit_hot_func=1 +--FILE-- + +--EXPECT-- +int(43) +int(43) +int(43) +int(43) +int(43)