Skip to content

Commit c781896

Browse files
committed
Don't project traces that end in underflow
1 parent 5fa7e1b commit c781896

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

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)