Fix creating labels from backward branches.

This commit is contained in:
Maxim Poliakovski 2021-03-22 12:19:32 +01:00
parent a636439b47
commit 7a9e446434
1 changed files with 4 additions and 2 deletions

View File

@ -80,8 +80,9 @@ class M68KDasm:
else:
label = 'l_{:x}'.format(ea)
ops.append(label)
if ea >= addr and ea < (addr + size):
if ea not in self.labels:
self.labels[ea] = label
# discard current op because we've just replaced it
op_list.pop(0)
elif op.address_mode == M68K_AM_PCI_INDEX_BASE_DISP:
ops.append(instr.op_str)
@ -96,8 +97,9 @@ class M68KDasm:
else:
label = 'l_{:x}'.format(ea)
ops.append(label)
if ea >= addr and ea < (addr + size):
if ea not in self.labels:
self.labels[ea] = label
# discard current op because we've just replaced it
op_list.pop(0)
else:
ops.append(op_list.pop(0))