Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
ASSERT_NO_REDUNDANT_JUMPS macro
  • Loading branch information
iritkatriel committed Aug 30, 2022
commit e47688ae7b83d174708051f96496a1154ff476e1
7 changes: 6 additions & 1 deletion Python/compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -8496,8 +8496,13 @@ no_redundant_jumps(cfg_builder *g) {
}
return true;
}

#define ASSERT_NO_REDUNDANT_JUMPS(G) assert(no_redundant_jumps(G))
#else
#define ASSERT_NO_REDUNDANT_JUMPS(G)
#endif


static int
remove_redundant_jumps(cfg_builder *g) {
/* If a non-empty block ends with a jump instruction, check if the next
Expand Down Expand Up @@ -8644,7 +8649,7 @@ assemble(struct compiler *c, int addNone)
goto error;
}

assert(no_redundant_jumps(g));
ASSERT_NO_REDUNDANT_JUMPS(g);

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