diff --git a/ext/opcache/jit/zend_jit_arm64.dasc b/ext/opcache/jit/zend_jit_arm64.dasc index 34f6b8018cb..f80b80f7707 100644 --- a/ext/opcache/jit/zend_jit_arm64.dasc +++ b/ext/opcache/jit/zend_jit_arm64.dasc @@ -2358,7 +2358,8 @@ static int zend_jit_trace_halt_stub(dasm_State **Dst) | EXT_JMP zend_jit_halt_op->handler, REG0 } else if (GCC_GLOBAL_REGS) { | ldp x29, x30, [sp], # SPAD // stack alignment - | ret // PC must be zero + | mov IP, xzr // PC must be zero + | ret } else { | ldp FP, RX, T2 // retore FP and IP | ldp x29, x30, [sp], # NR_SPAD // stack alignment diff --git a/ext/opcache/jit/zend_jit_vm_helpers.c b/ext/opcache/jit/zend_jit_vm_helpers.c index 0dd6aefdbb4..a78fcf4f6f2 100644 --- a/ext/opcache/jit/zend_jit_vm_helpers.c +++ b/ext/opcache/jit/zend_jit_vm_helpers.c @@ -318,7 +318,10 @@ static zend_always_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_jit_trace_c if (UNEXPECTED(*(ZEND_OP_TRACE_INFO(opline, offset)->counter) <= 0)) { *(ZEND_OP_TRACE_INFO(opline, offset)->counter) = ZEND_JIT_COUNTER_INIT; if (UNEXPECTED(zend_jit_trace_hot_root(execute_data, opline) < 0)) { -#ifndef HAVE_GCC_GLOBAL_REGS +#ifdef HAVE_GCC_GLOBAL_REGS + opline = NULL; + return; +#else return -1; #endif } diff --git a/ext/opcache/jit/zend_jit_x86.dasc b/ext/opcache/jit/zend_jit_x86.dasc index d4e0fdcbf15..eb24c3614af 100644 --- a/ext/opcache/jit/zend_jit_x86.dasc +++ b/ext/opcache/jit/zend_jit_x86.dasc @@ -2372,7 +2372,8 @@ static int zend_jit_trace_halt_stub(dasm_State **Dst) | EXT_JMP zend_jit_halt_op->handler, r0 } else if (GCC_GLOBAL_REGS) { | add r4, SPAD // stack alignment - | ret // PC must be zero + | xor IP, IP // PC must be zero + | ret } else { | mov FP, aword T2 // restore FP | mov RX, aword T3 // restore IP