Skip to content

Commit 971142a

Browse files
committed
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0: JIT: Fixed exit from CALL VM with GCC Global Register Variables
2 parents 76348f3 + cfb21e8 commit 971142a

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

ext/opcache/jit/zend_jit_arm64.dasc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2358,7 +2358,8 @@ static int zend_jit_trace_halt_stub(dasm_State **Dst)
23582358
| EXT_JMP zend_jit_halt_op->handler, REG0
23592359
} else if (GCC_GLOBAL_REGS) {
23602360
| ldp x29, x30, [sp], # SPAD // stack alignment
2361-
| ret // PC must be zero
2361+
| mov IP, xzr // PC must be zero
2362+
| ret
23622363
} else {
23632364
| ldp FP, RX, T2 // retore FP and IP
23642365
| ldp x29, x30, [sp], # NR_SPAD // stack alignment

ext/opcache/jit/zend_jit_vm_helpers.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,10 @@ static zend_always_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_jit_trace_c
318318
if (UNEXPECTED(*(ZEND_OP_TRACE_INFO(opline, offset)->counter) <= 0)) {
319319
*(ZEND_OP_TRACE_INFO(opline, offset)->counter) = ZEND_JIT_COUNTER_INIT;
320320
if (UNEXPECTED(zend_jit_trace_hot_root(execute_data, opline) < 0)) {
321-
#ifndef HAVE_GCC_GLOBAL_REGS
321+
#ifdef HAVE_GCC_GLOBAL_REGS
322+
opline = NULL;
323+
return;
324+
#else
322325
return -1;
323326
#endif
324327
}

ext/opcache/jit/zend_jit_x86.dasc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2372,7 +2372,8 @@ static int zend_jit_trace_halt_stub(dasm_State **Dst)
23722372
| EXT_JMP zend_jit_halt_op->handler, r0
23732373
} else if (GCC_GLOBAL_REGS) {
23742374
| add r4, SPAD // stack alignment
2375-
| ret // PC must be zero
2375+
| xor IP, IP // PC must be zero
2376+
| ret
23762377
} else {
23772378
| mov FP, aword T2 // restore FP
23782379
| mov RX, aword T3 // restore IP

0 commit comments

Comments
 (0)