mirror of
https://github.com/python/cpython.git
synced 2025-07-23 03:05:38 +00:00
[3.11] GH-104405: Add missing PEP 523 checks (GH-104441)
This commit is contained in:
parent
4ade7c3369
commit
fbb6def08a
4 changed files with 35 additions and 17 deletions
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue