Skip to content

Commit

Permalink
Improved cross-referencing
Browse files Browse the repository at this point in the history
  • Loading branch information
Arakula authored Jan 26, 2021
1 parent 0211a3a commit a7106f9
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Disassembler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,17 @@ for (int i = GetLabelCount(bus) - 1; i >= 0; i--)
addr_t addaddr = pLbl->GetAddress() + offs;
AddLabel(addaddr, pLbl->GetType(),
s.substr(0, p), true, bus);
// copy all references to the base label
Label *pBaseLbl = FindLabel(addaddr, pLbl->GetType(), bus);
if (pBaseLbl)
{
for (size_t refi = 0; refi < pLbl->RefCount(); refi++)
{
AddrBus &ref = pLbl->GetRef(refi);
pBaseLbl->SetUsed(true, ref.addr, ref.bus);
}
}

// this might have caused an insertion, so restart here
i++;
continue;
Expand Down

0 comments on commit a7106f9

Please sign in to comment.