diff options
Diffstat (limited to 'miasm/core/asmblock.py')
| -rw-r--r-- | miasm/core/asmblock.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/miasm/core/asmblock.py b/miasm/core/asmblock.py index 8f47947f..93ad6b13 100644 --- a/miasm/core/asmblock.py +++ b/miasm/core/asmblock.py @@ -628,6 +628,7 @@ class AsmCFG(DiGraph): This method should be called if a block's '.bto' in nodes have been modified without notifying this instance to resynchronize edges. """ + self._pendings = {} for block in self.blocks: edges = [] # Rebuild edges from bto @@ -960,7 +961,9 @@ def fix_loc_offset(loc_db, loc_key, offset, modified): loc_offset = loc_db.get_location_offset(loc_key) if loc_offset == offset: return - loc_db.set_location_offset(loc_key, offset, force=True) + if loc_offset is not None: + loc_db.unset_location_offset(loc_key) + loc_db.set_location_offset(loc_key, offset) modified.add(loc_key) @@ -1209,7 +1212,7 @@ def assemble_block(mnemo, block, loc_db, conservative=False): data = b"" for expr in instr.raw: expr_int = fix_expr_val(expr, loc_db) - data += pck[expr_int.size](expr_int.arg) + data += pck[expr_int.size](int(expr_int)) instr.data = data instr.offset = offset_i |