Skip to content

Commit 48d050e

Browse files
committed
JIT: Disable recursive call optimization for VM without global register variables
A tail-call to VM handler from recursively called function may lead to pass control to incorrect stack frame.
1 parent 0510363 commit 48d050e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/opcache/jit/zend_jit_x86.dasc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10082,7 +10082,7 @@ static int zend_jit_do_fcall(dasm_State **Dst, const zend_op *opline, const zend
1008210082
}
1008310083
}
1008410084

10085-
if (!trace && op_array == &func->op_array
10085+
if (GCC_GLOBAL_REGS && !trace && op_array == &func->op_array
1008610086
&& num_args >= op_array->required_num_args) {
1008710087
/* recursive call */
1008810088
if (ZEND_OBSERVER_ENABLED) {

0 commit comments

Comments
 (0)