Skip to content

Commit 98c21be

Browse files
fix an off-by-one
1 parent be25244 commit 98c21be

3 files changed

Lines changed: 4 additions & 6 deletions

File tree

Lib/test/test_sys.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2254,7 +2254,7 @@ def frame_3_jit() -> None:
22542254
# 1 extra iteration for tracing.
22552255
for i in range(_testinternalcapi.TIER2_THRESHOLD + 2):
22562256
# Careful, doing this in the reverse order breaks tracing:
2257-
expected = {enabled} and i >= _testinternalcapi.TIER2_THRESHOLD + 1
2257+
expected = {enabled} and i >= _testinternalcapi.TIER2_THRESHOLD
22582258
assert sys._jit.is_active() is expected
22592259
frame_2_jit(expected)
22602260
assert sys._jit.is_active() is expected

Python/bytecodes.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5616,10 +5616,8 @@ dummy_func(
56165616
if (full) {
56175617
LEAVE_TRACING();
56185618
int err = stop_tracing_and_jit(tstate, frame);
5619-
ERROR_IF(err < 0);
5620-
// We can't use DISPATCH() here, as it may clobber oparg,
5621-
// which may have been set by a previous EXTENDED_ARG.
5622-
DISPATCH_GOTO_NON_TRACING();
5619+
ERROR_IF(err < 0);.
5620+
DISPATCH();
56235621
}
56245622
// Super instructions. Instruction deopted. There's a mismatch in what the stack expects
56255623
// in the optimizer. So we have to reflect in the trace correctly.

Python/generated_cases.c.h

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)