[3.13] GH-121012: Set index to -1 when list iterators become exhausted in tier 2 (GH-121483) (GH-121494)

This commit is contained in:
Miss Islington (bot) 2024-07-08 19:09:54 +02:00 committed by GitHub
parent bccfd8a53f
commit 2f8919ee3c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 20 additions and 3 deletions

View file

@ -2675,8 +2675,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;
}