Skip to content

Commit 6778d60

Browse files
committed
Fix observer VM interrupt during tracing JIT calls
1 parent 45fbe8a commit 6778d60

1 file changed

Lines changed: 4 additions & 13 deletions

File tree

ext/opcache/jit/zend_jit_ir.c

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10337,28 +10337,19 @@ static int zend_jit_do_fcall(zend_jit_ctx *jit, const zend_op *opline, const zen
1033710337
if (ZEND_OBSERVER_ENABLED && (!func || (func->common.fn_flags & (ZEND_ACC_CALL_VIA_TRAMPOLINE | ZEND_ACC_GENERATOR)) == 0)) {
1033810338
ir_ref observer_handler;
1033910339
ir_ref rx = jit_FP(jit);
10340+
const zend_op *observer_opline = NULL;
1034010341
struct jit_observer_fcall_is_unobserved_data unobserved_data = jit_observer_fcall_is_unobserved_start(jit, func, &observer_handler, rx, func_ref);
1034110342
if (trace && (trace->op != ZEND_JIT_TRACE_END || trace->stop != ZEND_JIT_TRACE_STOP_INTERPRETER)) {
1034210343
ZEND_ASSERT(trace[1].op == ZEND_JIT_TRACE_VM || trace[1].op == ZEND_JIT_TRACE_END);
10343-
jit_SET_EX_OPLINE(jit, trace[1].opline);
10344+
observer_opline = trace[1].opline;
10345+
jit_SET_EX_OPLINE(jit, observer_opline);
1034410346
} else if (GCC_GLOBAL_REGS) {
1034510347
// EX(opline) = opline
1034610348
ir_STORE(jit_EX(opline), jit_IP(jit));
1034710349
}
1034810350
jit_observer_fcall_begin(jit, rx, observer_handler);
1034910351

10350-
if (trace) {
10351-
int32_t exit_point = zend_jit_trace_get_exit_point(opline, ZEND_JIT_EXIT_TO_VM);
10352-
10353-
exit_addr = zend_jit_trace_get_exit_addr(exit_point);
10354-
if (!exit_addr) {
10355-
return 0;
10356-
}
10357-
} else {
10358-
exit_addr = NULL;
10359-
}
10360-
10361-
zend_jit_check_timeout(jit, NULL /* we're inside the called function */, exit_addr);
10352+
zend_jit_check_timeout(jit, observer_opline, NULL);
1036210353

1036310354
jit_observer_fcall_is_unobserved_end(jit, &unobserved_data);
1036410355
}

0 commit comments

Comments
 (0)