diff options
author | Mark Shannon <mark@hotpy.org> | 2024-07-08 13:20:13 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-08 13:20:13 (GMT) |
commit | 8ad6067bd4556afddc86004f8e350aa672fda217 (patch) | |
tree | 15a15f25d7d11db22399be2a26ec6e2ae889976c /Python/executor_cases.c.h | |
parent | d69529d31ccd1510843cfac1ab53bb8cb027541f (diff) | |
download | cpython-8ad6067bd4556afddc86004f8e350aa672fda217.zip cpython-8ad6067bd4556afddc86004f8e350aa672fda217.tar.gz cpython-8ad6067bd4556afddc86004f8e350aa672fda217.tar.bz2 |
GH-121012: Set index to -1 when list iterators become exhausted in tier 2 (GH-121483)
Diffstat (limited to 'Python/executor_cases.c.h')
-rw-r--r-- | Python/executor_cases.c.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Python/executor_cases.c.h b/Python/executor_cases.c.h index 3b99946..8f6bc75 100644 --- a/Python/executor_cases.c.h +++ b/Python/executor_cases.c.h @@ -3055,8 +3055,11 @@ JUMP_TO_JUMP_TARGET(); } if ((size_t)it->it_index >= (size_t)PyList_GET_SIZE(seq)) { - UOP_STAT_INC(uopcode, miss); - JUMP_TO_JUMP_TARGET(); + it->it_index = -1; + if (1) { + UOP_STAT_INC(uopcode, miss); + JUMP_TO_JUMP_TARGET(); + } } break; } |