8000 Add missing RESERVEs · python/cpython@159e46b · GitHub
[go: up one dir, main page]

Skip to content

Commit 159e46b

Browse files
committed
Add missing RESERVEs
1 parent f1f5d13 commit 159e46b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Python/optimizer.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ translate_bytecode_to_trace(
578578
uint32_t oparg = instr->op.arg;
579579

580580
if (!progress_needed && instr == initial_instr) {
581-
// We have looped round to the start
581+
// We have looped around to the start:
582582
RESERVE(1);
583583
ADD_TO_TRACE(_JUMP_TO_TOP, 0, 0, 0);
584584
goto done;
@@ -618,11 +618,13 @@ translate_bytecode_to_trace(
618618
}
619619

620620
if (OPCODE_HAS_EXIT(opcode)) {
621-
// Make space for exit code
621+
// Make space for side exit and final _EXIT_TRACE:
622+
RESERVE_RAW(2, "_EXIT_TRACE");
622623
max_length--;
623624
}
624625
if (OPCODE_HAS_ERROR(opcode)) {
625-
// Make space for error code
626+
// Make space for error stub and final _EXIT_TRACE:
627+
RESERVE_RAW(2, "_ERROR_POP_N");
626628
max_length--;
627629
}
628630
switch (opcode) {
@@ -669,6 +671,7 @@ translate_bytecode_to_trace(
669671

670672
case JUMP_BACKWARD:
671673
ADD_TO_TRACE(_CHECK_PERIODIC, 0, 0, target);
674+
_Py_FALLTHROUGH;
672675
case JUMP_BACKWARD_NO_INTERRUPT:
673676
{
674677
instr += 1 + _PyOpcode_Caches[_PyOpcode_Deopt[opcode]] - (int)oparg;

0 commit comments

Comments
 (0)
0