Skip to content

Commit

Permalink
We still need to translate an instruction, even if progress isn't needed
Browse files Browse the repository at this point in the history
  • Loading branch information
brandtbucher committed Jul 30, 2024
1 parent 1e7db3e commit 62e781e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Python/optimizer.c
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,8 @@ translate_bytecode_to_trace(
RESERVE_RAW(2, "_CHECK_VALIDITY_AND_SET_IP");
ADD_TO_TRACE(_CHECK_VALIDITY_AND_SET_IP, 0, (uintptr_t)instr, target);

if (progress_needed) {
if (first && progress_needed) {
assert(first);
if (OPCODE_HAS_EXIT(opcode) || OPCODE_HAS_DEOPT(opcode)) {
opcode = _PyOpcode_Deopt[opcode];
}
Expand Down Expand Up @@ -912,7 +913,6 @@ translate_bytecode_to_trace(
}
top:
// Jump here after _PUSH_FRAME or likely branches.
progress_needed = false;
first = false;
} // End for (;;)

Expand All @@ -922,7 +922,7 @@ translate_bytecode_to_trace(
}
assert(code == initial_code);
// Skip short traces where we can't even translate a single instruction:
if (progress_needed) {
if (first) {
OPT_STAT_INC(trace_too_short);
DPRINTF(2,
"No trace for %s (%s:%d) at byte offset %d (no progress)\n",
Expand Down

0 comments on commit 62e781e

Please sign in to comment.