[3.10] GH-95921: Fix positions for some chained comparisons (GH-96968) (GH-96974)

(cherry picked from commit dfc73b5724)

Automerge-Triggered-By: GH:brandtbucher
This commit is contained in:
Brandt Bucher 2022-09-20 15:26:56 -07:00 committed by GitHub
parent 21b5af9072
commit aced809dc4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 1671 additions and 1637 deletions

View file

@ -2691,6 +2691,7 @@ compiler_jump_if(struct compiler *c, expr_ty e, basicblock *next, int cond)
return 1;
}
case Compare_kind: {
SET_LOC(c, e);
Py_ssize_t i, n = asdl_seq_LEN(e->v.Compare.ops) - 1;
if (n > 0) {
if (!check_compare(c, e)) {