summaryrefslogtreecommitdiffstats
path: root/Python/ceval.c
diff options
context:
space:
mode:
authorBrandt Bucher <brandtbucher@microsoft.com>2022-03-04 18:51:27 (GMT)
committerGitHub <noreply@github.com>2022-03-04 18:51:27 (GMT)
commitc4d2d57eefb1224a12e2e95e4508658dfbf6a7c9 (patch)
tree360ccc920f2e6afe516d038338f53f1e75d2136d /Python/ceval.c
parentcedd2473a9bebe07f3ced4f341cf58a2fef07b03 (diff)
downloadcpython-c4d2d57eefb1224a12e2e95e4508658dfbf6a7c9.zip
cpython-c4d2d57eefb1224a12e2e95e4508658dfbf6a7c9.tar.gz
cpython-c4d2d57eefb1224a12e2e95e4508658dfbf6a7c9.tar.bz2
bpo-46841: Fix BINARY_OP's handling of inline caches (GH-31671)
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 67c8b46..0743894 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -2028,8 +2028,9 @@ handle_eval_breaker:
DEOPT_IF(!PyUnicode_CheckExact(left), BINARY_OP);
DEOPT_IF(Py_TYPE(right) != Py_TYPE(left), BINARY_OP);
DEOPT_IF(Py_REFCNT(left) != 2, BINARY_OP);
- int next_oparg = _Py_OPARG(*next_instr);
- assert(_Py_OPCODE(*next_instr) == STORE_FAST);
+ _Py_CODEUNIT true_next = next_instr[INLINE_CACHE_ENTRIES_BINARY_OP];
+ int next_oparg = _Py_OPARG(true_next);
+ assert(_Py_OPCODE(true_next) == STORE_FAST);
/* In the common case, there are 2 references to the value
* stored in 'variable' when the v = v + ... is performed: one
* on the value stack (in 'v') and one still stored in the