Skip to content

Commit 29fc650

Browse files
authored
Added empty AsmBlock check to sanity_check
It causes ambiguities during assembling and there's no straightforward warning
1 parent e6580f5 commit 29fc650

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

miasm/core/asmblock.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -729,6 +729,10 @@ def sanity_check(self):
729729
for loc_key in self._nodes:
730730
if loc_key not in self._loc_key_to_block:
731731
raise RuntimeError("Not supported yet: every node must have a corresponding AsmBlock")
732+
733+
if not self.loc_key_to_block(loc_key).lines:
734+
raise RuntimeError("Blocks cannot be empty")
735+
732736
# No next constraint to self
733737
if (loc_key, loc_key) in next_edges:
734738
raise RuntimeError('Bad constraint: self in next')

0 commit comments

Comments
 (0)