Skip to content

Commit 28e24e7

Browse files
committed
Fixed JIT for indirectly recursive traces
1 parent 72383cc commit 28e24e7

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

ext/opcache/jit/zend_jit_trace.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4677,15 +4677,26 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
46774677

46784678
if (handler) {
46794679
if (p->stop == ZEND_JIT_TRACE_STOP_RECURSIVE_CALL) {
4680-
op_array = trace_buffer->op_array;
4680+
const zend_op_array *rec_op_array;
4681+
4682+
rec_op_array = op_array = trace_buffer->op_array;
4683+
jit_extension =
4684+
(zend_jit_op_array_trace_extension*)ZEND_FUNC_INFO(op_array);
46814685
p = trace_buffer + ZEND_JIT_TRACE_START_REC_SIZE;
46824686
for (;;p++) {
46834687
if (p->op == ZEND_JIT_TRACE_VM) {
46844688
opline = p->opline;
46854689
} else if (p->op == ZEND_JIT_TRACE_ENTER) {
4686-
if (p->op_array == op_array) {
4690+
if (p->op_array == rec_op_array) {
46874691
zend_jit_trace_setup_ret_counter(opline, jit_extension->offset);
46884692
}
4693+
op_array = p->op_array;
4694+
jit_extension =
4695+
(zend_jit_op_array_trace_extension*)ZEND_FUNC_INFO(op_array);
4696+
} else if (p->op == ZEND_JIT_TRACE_BACK) {
4697+
op_array = p->op_array;
4698+
jit_extension =
4699+
(zend_jit_op_array_trace_extension*)ZEND_FUNC_INFO(op_array);
46894700
} else if (p->op == ZEND_JIT_TRACE_END) {
46904701
break;
46914702
}

0 commit comments

Comments
 (0)