Skip to content

Commit 0b87bec

Browse files
committed
Sanity check for empty AsmBlocks
1 parent 975a527 commit 0b87bec

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

miasm/core/asmblock.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -623,6 +623,11 @@ def sanity_check(self):
623623
for loc_key in self._nodes:
624624
if loc_key not in self._loc_key_to_block:
625625
raise RuntimeError("Not supported yet: every node must have a corresponding AsmBlock")
626+
627+
block = self.loc_key_to_block(loc_key)
628+
if not block.lines and not isinstance(block, AsmBlockBad):
629+
raise RuntimeError("Blocks cannot be empty")
630+
626631
# No next constraint to self
627632
if (loc_key, loc_key) in next_edges:
628633
raise RuntimeError('Bad constraint: self in next')

0 commit comments

Comments
 (0)