Skip to content
Permalink
Browse files

ReferencesModel: Simplify printer output, validate referenced item

  • Loading branch information...
Dax89 committed May 14, 2019
1 parent 92b2865 commit 6f0ff1b3170f28a2c99be96b69b44c9ec1baa5eb
Showing with 8 additions and 5 deletions.
  1. +8 −5 models/referencesmodel.cpp
@@ -60,7 +60,7 @@ QVariant ReferencesModel::data(const QModelIndex &index, int role) const
else if(index.column() == 2)
{
if((*it)->is(REDasm::ListingItem::InstructionItem))
return QString::fromStdString(m_printer->out(document->instruction((*it)->address)));
return QString::fromStdString(REDasm::simplified(m_printer->out(document->instruction((*it)->address))));
else if((*it)->is(REDasm::ListingItem::SymbolItem))
return QString::fromStdString(document->symbol((*it)->address)->name);
}
@@ -121,11 +121,14 @@ QString ReferencesModel::direction(address_t address) const
REDasm::ListingCursor* cur = m_disassembler->document()->cursor();
REDasm::ListingItem* item = m_disassembler->document()->itemAt(cur->currentLine());

if(address > item->address)
return "Down";
if(item)
{
if(address > item->address)
return "Down";

if(address < item->address)
return "Up";
if(address < item->address)
return "Up";
}

return "---";
}

0 comments on commit 6f0ff1b

Please sign in to comment.
You can’t perform that action at this time.