From: Dong-hee Na Date: Thu, 24 Aug 2023 23:03:26 +0000 (+0900) Subject: gh-107265: Ensure _PyCode_Quicken does not handle ENTER_EXECUTOR (gh-108460) X-Git-Tag: v3.13.0a1~785 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d6ac5c7b105fe57266bd71248e3ada41fedb5ba9;p=thirdparty%2FPython%2Fcpython.git gh-107265: Ensure _PyCode_Quicken does not handle ENTER_EXECUTOR (gh-108460) --- diff --git a/Python/specialize.c b/Python/specialize.c index a467f163f2ca..fac3c3ea57d0 100644 --- a/Python/specialize.c +++ b/Python/specialize.c @@ -300,6 +300,8 @@ _PyCode_Quicken(PyCodeObject *code) for (int i = 0; i < Py_SIZE(code); i++) { opcode = _Py_GetBaseOpcode(code, i); assert(opcode < MIN_INSTRUMENTED_OPCODE); + // _PyCode_Quicken is only called when initializing a fresh code object. + assert(opcode != ENTER_EXECUTOR); int caches = _PyOpcode_Caches[opcode]; if (caches) { instructions[i + 1].cache = adaptive_counter_warmup();