Skip to content

Commit 11bb08e

Browse files
authored
GH-129715: Don't project traces that return to an unknown caller (GH-130024)
1 parent 72f5665 commit 11bb08e

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Improve the experimental JIT's handling of returns to unknown callers.

Python/instrumentation.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,7 @@ is_instrumented(int opcode)
185185
{
186186
assert(opcode != 0);
187187
assert(opcode != RESERVED);
188-
assert(opcode != ENTER_EXECUTOR);
189-
return opcode >= MIN_INSTRUMENTED_OPCODE;
188+
return opcode != ENTER_EXECUTOR && opcode >= MIN_INSTRUMENTED_OPCODE;
190189
}
191190

192191
#ifndef NDEBUG

Python/optimizer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ translate_bytecode_to_trace(
671671
if (trace_stack_depth == 0) {
672672
DPRINTF(2, "Trace stack underflow\n");
673673
OPT_STAT_INC(trace_stack_underflow);
674-
goto done;
674+
return 0;
675675
}
676676
}
677677
uint32_t orig_oparg = oparg; // For OPARG_TOP/BOTTOM

0 commit comments

Comments
 (0)