Skip to content

Commit

Permalink
JIT: Disable recursive call optimization for VM without global regist…
Browse files Browse the repository at this point in the history
…er variables

A tail-call to VM handler from recursively called function may lead to
pass control to incorrect stack frame.
  • Loading branch information
dstogov committed Sep 21, 2021
1 parent 0510363 commit 48d050e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ext/opcache/jit/zend_jit_x86.dasc
Expand Up @@ -10082,7 +10082,7 @@ static int zend_jit_do_fcall(dasm_State **Dst, const zend_op *opline, const zend
}
}

if (!trace && op_array == &func->op_array
if (GCC_GLOBAL_REGS && !trace && op_array == &func->op_array
&& num_args >= op_array->required_num_args) {
/* recursive call */
if (ZEND_OBSERVER_ENABLED) {
Expand Down

0 comments on commit 48d050e

Please sign in to comment.