Skip to content

Commit 728b81d

Browse files
committed
Prevent recording traces started from usupported VM instruction
1 parent a18cf33 commit 728b81d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

ext/opcache/jit/zend_jit_vm_helpers.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -643,6 +643,16 @@ zend_jit_trace_stop ZEND_FASTCALL zend_jit_trace_execute(zend_execute_data *ex,
643643
return ZEND_JIT_TRACE_STOP_EXCEPTION;
644644
}
645645

646+
trace_flags = ZEND_OP_TRACE_INFO(opline, offset)->trace_flags;
647+
if (trace_flags & ZEND_JIT_TRACE_UNSUPPORTED) {
648+
TRACE_END(ZEND_JIT_TRACE_END, ZEND_JIT_TRACE_STOP_NOT_SUPPORTED, opline);
649+
#ifdef HAVE_GCC_GLOBAL_REGS
650+
execute_data = save_execute_data;
651+
opline = save_opline;
652+
#endif
653+
return ZEND_JIT_TRACE_STOP_NOT_SUPPORTED;
654+
}
655+
646656
if (prev_call) {
647657
int ret = zend_jit_trace_record_fake_init_call(prev_call, trace_buffer, idx, is_megamorphic);
648658
if (ret < 0) {

0 commit comments

Comments
 (0)