Skip to content

Commit

Permalink
Check room available for JUMP_TO_TOP
Browse files Browse the repository at this point in the history
  • Loading branch information
gvanrossum committed Jul 7, 2023
1 parent 681dcfe commit 80690c9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Python/optimizer.c
Original file line number Diff line number Diff line change
Expand Up @@ -455,9 +455,11 @@ translate_bytecode_to_trace(
}
case JUMP_BACKWARD:
{
if (instr + 2 - operand == initial_instr) {
if (instr + 2 - operand == initial_instr
&& trace_length + 3 <= max_length)
{
ADD_TO_TRACE(JUMP_TO_TOP, 0);
break;
goto done;
}
// Else fall through!
}
Expand Down

0 comments on commit 80690c9

Please sign in to comment.