diff options
| author | Brandt Bucher <brandtbucher@microsoft.com> | 2023-05-12 23:03:47 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-05-12 23:03:47 (GMT) |
| commit | fbb6def08a7ce7d21653e15ccbc4017b4eb2e795 (patch) | |
| tree | 85c86ae7bbc4afc2e3675d71b025e3f4246f6c8f /Python | |
| parent | 4ade7c33696b6a2a2e07295366ae0c29c31bb050 (diff) | |
| download | cpython-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')
| -rw-r--r-- | Python/ceval.c | 1 | ||||
| -rw-r--r-- | Python/specialize.c | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index 72f9c83..47df353 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -2233,6 +2233,7 @@ handle_eval_breaker: } TARGET(BINARY_SUBSCR_GETITEM) { + DEOPT_IF(tstate->interp->eval_frame, BINARY_SUBSCR); PyObject *sub = TOP(); PyObject *container = SECOND(); _PyBinarySubscrCache *cache = (_PyBinarySubscrCache *)next_instr; 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); |
