Skip to content

Commit 0e0f50b

Browse files
committed
JIT x86: Fixed incorrect EX(func) initialization for recursive calls
1 parent b17adff commit 0e0f50b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

ext/opcache/jit/zend_jit_x86.dasc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8923,7 +8923,14 @@ static int zend_jit_push_call_frame(dasm_State **Dst, const zend_op *opline, con
89238923
| EXT_CALL zend_jit_int_extend_stack_helper, r0
89248924
} else {
89258925
if (!is_closure) {
8926-
| mov FCARG2a, r0
8926+
if (func
8927+
&& op_array == &func->op_array
8928+
&& (func->op_array.fn_flags & ZEND_ACC_IMMUTABLE)
8929+
&& (sizeof(void*) != 8 || IS_SIGNED_32BIT(func))) {
8930+
| LOAD_ADDR FCARG2a, func
8931+
} else {
8932+
| mov FCARG2a, r0
8933+
}
89278934
} else {
89288935
| lea FCARG2a, aword [r0 + offsetof(zend_closure, func)]
89298936
}

0 commit comments

Comments
 (0)