Skip to content

Commit

Permalink
Added empty AsmBlock check to sanity_check
Browse files Browse the repository at this point in the history
It causes ambiguities during assembling and there's no straightforward warning
  • Loading branch information
nofiv authored May 29, 2020
1 parent e6580f5 commit 29fc650
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions miasm/core/asmblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,10 @@ def sanity_check(self):
for loc_key in self._nodes:
if loc_key not in self._loc_key_to_block:
raise RuntimeError("Not supported yet: every node must have a corresponding AsmBlock")

if not self.loc_key_to_block(loc_key).lines:
raise RuntimeError("Blocks cannot be empty")

# No next constraint to self
if (loc_key, loc_key) in next_edges:
raise RuntimeError('Bad constraint: self in next')
Expand Down

0 comments on commit 29fc650

Please sign in to comment.