Skip to content

Commit d6ac5c7

Browse files
authored
gh-107265: Ensure _PyCode_Quicken does not handle ENTER_EXECUTOR (gh-108460)
1 parent b32d4ca commit d6ac5c7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Python/specialize.c

+2
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,8 @@ _PyCode_Quicken(PyCodeObject *code)
300300
for (int i = 0; i < Py_SIZE(code); i++) {
301301
opcode = _Py_GetBaseOpcode(code, i);
302302
assert(opcode < MIN_INSTRUMENTED_OPCODE);
303+
// _PyCode_Quicken is only called when initializing a fresh code object.
304+
assert(opcode != ENTER_EXECUTOR);
303305
int caches = _PyOpcode_Caches[opcode];
304306
if (caches) {
305307
instructions[i + 1].cache = adaptive_counter_warmup();

0 commit comments

Comments
 (0)