diff options
author | Brandt Bucher <brandtbucher@microsoft.com> | 2022-07-22 18:04:20 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-22 18:04:20 (GMT) |
commit | e402b26b7fb953a2f0c17a0044bb6d6cbd726e54 (patch) | |
tree | b0b4dc8fd76d64028e0018066de86900949364e4 /Python/ceval.c | |
parent | 79d2f549adcbbefd4f2c0a0c9dd572bbbf252c62 (diff) | |
download | cpython-e402b26b7fb953a2f0c17a0044bb6d6cbd726e54.zip cpython-e402b26b7fb953a2f0c17a0044bb6d6cbd726e54.tar.gz cpython-e402b26b7fb953a2f0c17a0044bb6d6cbd726e54.tar.bz2 |
GH-95113: Don't use EXTENDED_ARG_QUICK in unquickened code (GH-95121)
Diffstat (limited to 'Python/ceval.c')
-rw-r--r-- | Python/ceval.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index 88d13c8..3a9b0e5 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -5631,8 +5631,16 @@ handle_eval_breaker: assert(oparg); oparg <<= 8; oparg |= _Py_OPARG(*next_instr); + // We might be tracing. To avoid breaking tracing guarantees in + // quickened instructions, always deoptimize the next opcode: opcode = _PyOpcode_Deopt[_Py_OPCODE(*next_instr)]; PRE_DISPATCH_GOTO(); + // CPython hasn't traced the following instruction historically + // (DO_TRACING would clobber our extended oparg anyways), so just + // skip our usual cframe.use_tracing check before dispatch. Also, + // make sure the next instruction isn't a RESUME, since that needs + // to trace properly (and shouldn't have an extended arg anyways): + assert(opcode != RESUME); DISPATCH_GOTO(); } |