Skip to content

Commit e47688a

Browse files
committed
ASSERT_NO_REDUNDANT_JUMPS macro
1 parent d0ffa15 commit e47688a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Python/compile.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8496,8 +8496,13 @@ no_redundant_jumps(cfg_builder *g) {
84968496
}
84978497
return true;
84988498
}
8499+
8500+
#define ASSERT_NO_REDUNDANT_JUMPS(G) assert(no_redundant_jumps(G))
8501+
#else
8502+
#define ASSERT_NO_REDUNDANT_JUMPS(G)
84998503
#endif
85008504

8505+
85018506
static int
85028507
remove_redundant_jumps(cfg_builder *g) {
85038508
/* If a non-empty block ends with a jump instruction, check if the next
@@ -8644,7 +8649,7 @@ assemble(struct compiler *c, int addNone)
86448649
goto error;
86458650
}
86468651

8647-
assert(no_redundant_jumps(g));
8652+
ASSERT_NO_REDUNDANT_JUMPS(g);
86488653

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

0 commit comments

Comments
 (0)