summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
Diffstat (limited to 'Python')
-rw-r--r--Python/ceval.c1
-rw-r--r--Python/specialize.c4
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);