Skip to content

Commit 80690c9

Browse files
committed
Check room available for JUMP_TO_TOP
1 parent 681dcfe commit 80690c9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Python/optimizer.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -455,9 +455,11 @@ translate_bytecode_to_trace(
455455
}
456456
case JUMP_BACKWARD:
457457
{
458-
if (instr + 2 - operand == initial_instr) {
458+
if (instr + 2 - operand == initial_instr
459+
&& trace_length + 3 <= max_length)
460+
{
459461
ADD_TO_TRACE(JUMP_TO_TOP, 0);
460-
break;
462+
goto done;
461463
}
462464
// Else fall through!
463465
}

0 commit comments

Comments
 (0)