]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-107265: Ensure _PyCode_Quicken does not handle ENTER_EXECUTOR (gh-108460)
authorDong-hee Na <donghee.na@python.org>
Thu, 24 Aug 2023 23:03:26 +0000 (08:03 +0900)
committerGitHub <noreply@github.com>
Thu, 24 Aug 2023 23:03:26 +0000 (23:03 +0000)
Python/specialize.c

index a467f163f2ca9d2b850b2320db7f62b6bbae528c..fac3c3ea57d004642d8114a737537c3a570bbf78 100644 (file)
@@ -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();