diff --git a/ext/opcache/jit/zend_jit_ir.c b/ext/opcache/jit/zend_jit_ir.c index aee2afa7a513d..ddb859895bd4a 100644 --- a/ext/opcache/jit/zend_jit_ir.c +++ b/ext/opcache/jit/zend_jit_ir.c @@ -9327,6 +9327,7 @@ static int zend_jit_init_static_method_call(zend_jit_ctx *jit, ir_IF_FALSE_cold(if_static); } + jit_SET_EX_OPLINE(jit, opline); ref = ir_CALL_3(IR_ADDR, ir_CONST_FC_FUNC(zend_jit_push_this_method_call_frame), scope_ref, func_ref, diff --git a/ext/opcache/tests/jit/gh17727.phpt b/ext/opcache/tests/jit/gh17727.phpt new file mode 100644 index 0000000000000..425315f215a6e --- /dev/null +++ b/ext/opcache/tests/jit/gh17727.phpt @@ -0,0 +1,31 @@ +--TEST-- +GH-17727 (JIT SEGV on OOM in dtor when creating backtrace) +--EXTENSIONS-- +opcache +--SKIPIF-- + +--INI-- +opcache.jit=1254 +fatal_error_backtraces=1 +memory_limit=2M +--CREDITS-- +arnaud-lb +YuanchengJiang +--FILE-- + +--EXPECTF-- +Fatal error: Allowed memory size of 2097152 bytes exhausted %s +Stack trace: +%A