diff options
author | Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com> | 2022-04-17 18:04:29 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-17 18:04:29 (GMT) |
commit | cec5d858f509ea28a5325b75fd94e2f275866f5f (patch) | |
tree | fd1a12cd8c374b3eddca3f5ef1baaff98fefd217 /Python/ceval.c | |
parent | 7659681556977fe3a19d9f4c5dd93362b9eae25c (diff) | |
download | cpython-cec5d858f509ea28a5325b75fd94e2f275866f5f.zip cpython-cec5d858f509ea28a5325b75fd94e2f275866f5f.tar.gz cpython-cec5d858f509ea28a5325b75fd94e2f275866f5f.tar.bz2 |
gh-91625: Don't ignore extended args of adaptive opcodes (GH-91626)
Diffstat (limited to 'Python/ceval.c')
-rw-r--r-- | Python/ceval.c | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index d358a31..f523e52 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -1351,6 +1351,13 @@ eval_frame_handle_pending(PyThreadState *tstate) DISPATCH_GOTO(); \ } +#define NOTRACE_DISPATCH_SAME_OPARG() \ + { \ + opcode = _Py_OPCODE(*next_instr); \ + PRE_DISPATCH_GOTO(); \ + DISPATCH_GOTO(); \ + } + #define CHECK_EVAL_BREAKER() \ _Py_CHECK_EMSCRIPTEN_SIGNALS_PERIODICALLY(); \ if (_Py_atomic_load_relaxed(eval_breaker)) { \ @@ -2158,7 +2165,7 @@ handle_eval_breaker: if (_Py_Specialize_BinarySubscr(container, sub, next_instr) < 0) { goto error; } - DISPATCH(); + NOTRACE_DISPATCH_SAME_OPARG(); } else { STAT_INC(BINARY_SUBSCR, deferred); @@ -2323,7 +2330,7 @@ handle_eval_breaker: if (_Py_Specialize_StoreSubscr(container, sub, next_instr) < 0) { goto error; } - DISPATCH(); + NOTRACE_DISPATCH_SAME_OPARG(); } else { STAT_INC(STORE_SUBSCR, deferred); @@ -2813,7 +2820,7 @@ handle_eval_breaker: PyObject *seq = TOP(); next_instr--; _Py_Specialize_UnpackSequence(seq, next_instr, oparg); - DISPATCH(); + NOTRACE_DISPATCH_SAME_OPARG(); } else { STAT_INC(UNPACK_SEQUENCE, deferred); @@ -3056,7 +3063,7 @@ handle_eval_breaker: if (_Py_Specialize_LoadGlobal(GLOBALS(), BUILTINS(), next_instr, name) < 0) { goto error; } - DISPATCH(); + NOTRACE_DISPATCH_SAME_OPARG(); } else { STAT_INC(LOAD_GLOBAL, deferred); @@ -3481,7 +3488,7 @@ handle_eval_breaker: if (_Py_Specialize_LoadAttr(owner, next_instr, name) < 0) { goto error; } - DISPATCH(); + NOTRACE_DISPATCH_SAME_OPARG(); } else { STAT_INC(LOAD_ATTR, deferred); @@ -3590,7 +3597,7 @@ handle_eval_breaker: if (_Py_Specialize_StoreAttr(owner, next_instr, name) < 0) { goto error; } - DISPATCH(); + NOTRACE_DISPATCH_SAME_OPARG(); } else { STAT_INC(STORE_ATTR, deferred); @@ -3718,7 +3725,7 @@ handle_eval_breaker: PyObject *left = SECOND(); next_instr--; _Py_Specialize_CompareOp(left, right, next_instr, oparg); - DISPATCH(); + NOTRACE_DISPATCH_SAME_OPARG(); } else { STAT_INC(COMPARE_OP, deferred); @@ -4523,7 +4530,7 @@ handle_eval_breaker: if (_Py_Specialize_LoadMethod(owner, next_instr, name) < 0) { goto error; } - DISPATCH(); + NOTRACE_DISPATCH_SAME_OPARG(); } else { STAT_INC(LOAD_METHOD, deferred); @@ -4797,7 +4804,7 @@ handle_eval_breaker: if (err < 0) { goto error; } - DISPATCH(); + NOTRACE_DISPATCH_SAME_OPARG(); } else { STAT_INC(PRECALL, deferred); @@ -4818,7 +4825,7 @@ handle_eval_breaker: if (err < 0) { goto error; } - DISPATCH(); + NOTRACE_DISPATCH_SAME_OPARG(); } else { STAT_INC(CALL, deferred); @@ -5545,7 +5552,7 @@ handle_eval_breaker: PyObject *rhs = TOP(); next_instr--; _Py_Specialize_BinaryOp(lhs, rhs, next_instr, oparg, &GETLOCAL(0)); - DISPATCH(); + NOTRACE_DISPATCH_SAME_OPARG(); } else { STAT_INC(BINARY_OP, deferred); @@ -5564,11 +5571,9 @@ handle_eval_breaker: TARGET(EXTENDED_ARG) { assert(oparg); - int oldoparg = oparg; - NEXTOPARG(); - oparg |= oldoparg << 8; - PRE_DISPATCH_GOTO(); - DISPATCH_GOTO(); + oparg <<= 8; + oparg |= _Py_OPARG(*next_instr); + NOTRACE_DISPATCH_SAME_OPARG(); } TARGET(CACHE) { |