Skip to content

Commit 681dcfe

Browse files
committed
Tweak FOR_ITER so it's viable
1 parent a7a6e00 commit 681dcfe

File tree

3 files changed

+144
-140
lines changed

3 files changed

+144
-140
lines changed

Python/bytecodes.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -2415,12 +2415,14 @@ dummy_func(
24152415
if (!_PyErr_ExceptionMatches(tstate, PyExc_StopIteration)) {
24162416
goto error;
24172417
}
2418-
monitor_raise(tstate, frame, next_instr-1);
2418+
monitor_raise(tstate, frame, frame->prev_instr);
24192419
_PyErr_Clear(tstate);
24202420
}
24212421
/* iterator ended normally */
2422+
#if ENABLE_SPECIALIZATION
24222423
assert(next_instr[INLINE_CACHE_ENTRIES_FOR_ITER + oparg].op.code == END_FOR ||
24232424
next_instr[INLINE_CACHE_ENTRIES_FOR_ITER + oparg].op.code == INSTRUMENTED_END_FOR);
2425+
#endif
24242426
Py_DECREF(iter);
24252427
/* Jump forward oparg, then skip following END_FOR instruction */
24262428
JUMP_POP_DISPATCH(INLINE_CACHE_ENTRIES_FOR_ITER + oparg + 1, 1);

Python/executor_cases.c.h

+15-15
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)