diff options
author | Mark Shannon <mark@hotpy.org> | 2024-08-01 09:27:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-01 09:27:26 +0100 |
commit | a9d56e38a08ec198a2289d8fff65444b39dd4a32 (patch) | |
tree | 86f180623f37e739812215964826fd48c7de873b /Python/bytecodes.c | |
parent | 46f5a4f9e1781ad8d60eb53bbaf6cd8534a286cd (diff) | |
download | cpython-a9d56e38a08ec198a2289d8fff65444b39dd4a32.tar.gz cpython-a9d56e38a08ec198a2289d8fff65444b39dd4a32.zip |
GH-122155: Track local variables between pops and pushes in cases generator (GH-122286)
Diffstat (limited to 'Python/bytecodes.c')
-rw-r--r-- | Python/bytecodes.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Python/bytecodes.c b/Python/bytecodes.c index 4afce2cc3be..abfd8039b29 100644 --- a/Python/bytecodes.c +++ b/Python/bytecodes.c @@ -1357,8 +1357,8 @@ dummy_func( (void)counter; } - op(_UNPACK_SEQUENCE, (seq -- unused[oparg])) { - _PyStackRef *top = stack_pointer + oparg - 1; + op(_UNPACK_SEQUENCE, (seq -- output[oparg])) { + _PyStackRef *top = output + oparg; int res = _PyEval_UnpackIterableStackRef(tstate, seq, oparg, -1, top); DECREF_INPUTS(); ERROR_IF(res == 0, error); @@ -1401,9 +1401,8 @@ dummy_func( DECREF_INPUTS(); } - inst(UNPACK_EX, (seq -- unused[oparg & 0xFF], unused, unused[oparg >> 8])) { - int totalargs = 1 + (oparg & 0xFF) + (oparg >> 8); - _PyStackRef *top = stack_pointer + totalargs - 1; + inst(UNPACK_EX, (seq -- left[oparg & 0xFF], unused, right[oparg >> 8])) { + _PyStackRef *top = right + (oparg >> 8); int res = _PyEval_UnpackIterableStackRef(tstate, seq, oparg & 0xFF, oparg >> 8, top); DECREF_INPUTS(); ERROR_IF(res == 0, error); |