Skip to content

Commit 3b799d7

Browse files
authored
Remove unnecessary basic block from comprehensions (GH-31263)
1 parent 96084f4 commit 3b799d7

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

Python/compile.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5034,17 +5034,16 @@ compiler_sync_comprehension_generator(struct compiler *c,
50345034
and then write to the element */
50355035

50365036
comprehension_ty gen;
5037-
basicblock *start, *anchor, *skip, *if_cleanup;
5037+
basicblock *start, *anchor, *if_cleanup;
50385038
Py_ssize_t i, n;
50395039

50405040
start = compiler_new_block(c);
5041-
skip = compiler_new_block(c);
50425041
if_cleanup = compiler_new_block(c);
50435042
anchor = compiler_new_block(c);
50445043

5045-
if (start == NULL || skip == NULL || if_cleanup == NULL ||
5046-
anchor == NULL)
5044+
if (start == NULL || if_cleanup == NULL || anchor == NULL) {
50475045
return 0;
5046+
}
50485047

50495048
gen = (comprehension_ty)asdl_seq_GET(generators, gen_index);
50505049

@@ -5131,8 +5130,6 @@ compiler_sync_comprehension_generator(struct compiler *c,
51315130
default:
51325131
return 0;
51335132
}
5134-
5135-
compiler_use_next_block(c, skip);
51365133
}
51375134
compiler_use_next_block(c, if_cleanup);
51385135
if (start) {

0 commit comments

Comments
 (0)