summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorDong-hee Na <donghee.na@python.org>2023-08-24 23:03:26 (GMT)
committerGitHub <noreply@github.com>2023-08-24 23:03:26 (GMT)
commitd6ac5c7b105fe57266bd71248e3ada41fedb5ba9 (patch)
tree85cee3a6113ff1425d7a5749ca53f06affd40d62 /Python
parentb32d4cad15f537f25063bcd56377e16df59d98db (diff)
downloadcpython-d6ac5c7b105fe57266bd71248e3ada41fedb5ba9.zip
cpython-d6ac5c7b105fe57266bd71248e3ada41fedb5ba9.tar.gz
cpython-d6ac5c7b105fe57266bd71248e3ada41fedb5ba9.tar.bz2
gh-107265: Ensure _PyCode_Quicken does not handle ENTER_EXECUTOR (gh-108460)
Diffstat (limited to 'Python')
-rw-r--r--Python/specialize.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Python/specialize.c b/Python/specialize.c
index a467f16..fac3c3e 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();