summaryrefslogtreecommitdiffstats
path: root/Python/specialize.c
diff options
context:
space:
mode:
authorBrandt Bucher <brandtbucher@microsoft.com>2023-05-12 23:03:47 (GMT)
committerGitHub <noreply@github.com>2023-05-12 23:03:47 (GMT)
commitfbb6def08a7ce7d21653e15ccbc4017b4eb2e795 (patch)
tree85c86ae7bbc4afc2e3675d71b025e3f4246f6c8f /Python/specialize.c
parent4ade7c33696b6a2a2e07295366ae0c29c31bb050 (diff)
downloadcpython-fbb6def08a7ce7d21653e15ccbc4017b4eb2e795.zip
cpython-fbb6def08a7ce7d21653e15ccbc4017b4eb2e795.tar.gz
cpython-fbb6def08a7ce7d21653e15ccbc4017b4eb2e795.tar.bz2
[3.11] GH-104405: Add missing PEP 523 checks (GH-104441)
Diffstat (limited to 'Python/specialize.c')
-rw-r--r--Python/specialize.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Python/specialize.c b/Python/specialize.c
index 08ce2f5..9d182fd 100644
--- a/Python/specialize.c
+++ b/Python/specialize.c
@@ -1238,6 +1238,10 @@ _Py_Specialize_BinarySubscr(
SPECIALIZATION_FAIL(BINARY_SUBSCR, SPEC_FAIL_OUT_OF_VERSIONS);
goto fail;
}
+ if (_PyInterpreterState_GET()->eval_frame) {
+ SPECIALIZATION_FAIL(BINARY_SUBSCR, SPEC_FAIL_OTHER);
+ goto fail;
+ }
cache->func_version = version;
((PyHeapTypeObject *)container_type)->_spec_cache.getitem = descriptor;
_Py_SET_OPCODE(*instr, BINARY_SUBSCR_GETITEM);