diff options
| -rw-r--r-- | miasm2/core/asmbloc.py | 3 | ||||
| -rw-r--r-- | miasm2/ir/ir.py | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/miasm2/core/asmbloc.py b/miasm2/core/asmbloc.py index a6d652be..7089e888 100644 --- a/miasm2/core/asmbloc.py +++ b/miasm2/core/asmbloc.py @@ -103,7 +103,8 @@ class asm_constraint_to(asm_constraint): class asm_bloc(object): - def __init__(self, label=None, alignment=1): + def __init__(self, label, alignment=1): + assert isinstance(label, asm_label) self.bto = set() self.lines = [] self.label = label diff --git a/miasm2/ir/ir.py b/miasm2/ir/ir.py index f957fcab..9d90f79a 100644 --- a/miasm2/ir/ir.py +++ b/miasm2/ir/ir.py @@ -202,7 +202,7 @@ class ir(object): return self.blocs.get(label, None) def add_instr(self, l, ad=0, gen_pc_updt = False): - b = asm_bloc(l) + b = asm_bloc(self.gen_label()) b.lines = [l] self.add_bloc(b, gen_pc_updt) |