Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 79036ff

Browse files
committed
Fix tests
1 parent 8c74dfa commit 79036ff

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Python/bytecodes.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2348,7 +2348,7 @@ dummy_func(
23482348
JUMPBY(-oparg);
23492349
#if ENABLE_SPECIALIZATION
23502350
uint16_t counter = this_instr[1].cache;
2351-
if (ADAPTIVE_COUNTER_IS_ZERO(counter) && this_instr->op.code == JUMP_BACKWARD) {
2351+
if (ADAPTIVE_COUNTER_IS_ZERO(counter)) {
23522352
if (counter == 0) {
23532353
// Dynamically initialize the counter
23542354
PyInterpreterState *interp = tstate->interp;
@@ -2358,7 +2358,7 @@ dummy_func(
23582358
this_instr[1].cache = counter;
23592359
}
23602360
}
2361-
else {
2361+
if (ADAPTIVE_COUNTER_IS_ZERO(counter) && this_instr->op.code == JUMP_BACKWARD) {
23622362
_Py_CODEUNIT *start = this_instr;
23632363
/* Back up over EXTENDED_ARGs so optimizer sees the whole instruction */
23642364
while (oparg > 255) {

Python/generated_cases.c.h

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/optimizer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ shift_and_offset_threshold(uint32_t threshold)
136136
if (threshold == OPTIMIZER_UNREACHABLE_THRESHOLD) {
137137
return threshold;
138138
}
139-
return adaptive_counter_bits(threshold - 1, MIN_TIER2_BACKOFF);
139+
return adaptive_counter_bits(threshold, MIN_TIER2_BACKOFF);
140140
}
141141

142142
_PyOptimizerObject *

0 commit comments

Comments
 (0)