diff --git a/ext/opcache/jit/zend_jit_ir.c b/ext/opcache/jit/zend_jit_ir.c index c3ab026deec2f..de37e73a24019 100644 --- a/ext/opcache/jit/zend_jit_ir.c +++ b/ext/opcache/jit/zend_jit_ir.c @@ -16811,6 +16811,9 @@ static int zend_jit_trace_end_loop(zend_jit_ctx *jit, int loop_ref, const void * static int zend_jit_trace_return(zend_jit_ctx *jit, bool original_handler, const zend_op *opline) { + if (!original_handler && jit->reuse_ip) { + zend_jit_set_ip(jit, opline); + } if (GCC_GLOBAL_REGS) { if (!original_handler) { ir_TAILCALL(IR_VOID, ir_LOAD_A(jit_IP(jit))); diff --git a/ext/opcache/jit/zend_jit_trace.c b/ext/opcache/jit/zend_jit_trace.c index ee505c2f4670d..dadeeac68f311 100644 --- a/ext/opcache/jit/zend_jit_trace.c +++ b/ext/opcache/jit/zend_jit_trace.c @@ -7225,10 +7225,10 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par } zend_jit_trace_link_to_root(&ctx, &zend_jit_traces[t->link], timeout_exit_addr); } else { - zend_jit_trace_return(&ctx, 0, NULL); + zend_jit_trace_return(&ctx, 0, p->opline); } } else if (p->stop == ZEND_JIT_TRACE_STOP_RETURN) { - zend_jit_trace_return(&ctx, 0, NULL); + zend_jit_trace_return(&ctx, 0, p->opline); } else { // TODO: not implemented ??? ZEND_ASSERT(0 && p->stop);