Skip to content

Commit d0ffa15

Browse files
committed
assert_no_redundant_jumps --> no_redundant_jumps
1 parent d249b04 commit d0ffa15

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Python/compile.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -8483,16 +8483,18 @@ static void
84838483
eliminate_empty_basic_blocks(cfg_builder *g);
84848484

84858485
#ifdef Py_DEBUG
8486-
static void
8487-
assert_no_redundant_jumps(cfg_builder *g) {
8486+
static bool
8487+
no_redundant_jumps(cfg_builder *g) {
84888488
for (basicblock *b = g->g_entryblock; b != NULL; b = b->b_next) {
84898489
struct instr *last = basicblock_last_instr(b);
84908490
if (last != NULL) {
84918491
if (last->i_opcode == JUMP || last->i_opcode == JUMP_NO_INTERRUPT) {
84928492
assert(last->i_target != b->b_next);
8493+
return false;
84938494
}
84948495
}
84958496
}
8497+
return true;
84968498
}
84978499
#endif
84988500

@@ -8642,9 +8644,7 @@ assemble(struct compiler *c, int addNone)
86428644
goto error;
86438645
}
86448646

8645-
#ifdef Py_DEBUG
8646-
assert_no_redundant_jumps(g);
8647-
#endif
8647+
assert(no_redundant_jumps(g));
86488648

86498649
/* Can't modify the bytecode after computing jump offsets. */
86508650
assemble_jump_offsets(g->g_entryblock);

0 commit comments

Comments
 (0)