Skip to content
Snippets Groups Projects
Commit d434b06b authored by Leon Weiss's avatar Leon Weiss
Browse files

Move base ID into original instruction in order to keep the annotation mapping intact

Otherwise annotations would now belong to the newly inserted instruction
parent 5f5d3169
No related branches found
No related tags found
1 merge request!47Improve jump table detection and debugging output
......@@ -52,6 +52,9 @@ Instruction_t* IRDB_SDK::insertAssemblyBefore(FileIR_t* virp, Instruction_t* fir
next->setOriginalAddressID(first->getOriginalAddressID());
//"Null" out the original address (it should be as if the instruction was not in the database).
first->setOriginalAddressID(BaseObj_t::NOT_IN_DATABASE);
// Keep Base ID in the original instruction
next->setBaseID(first->getBaseID());
first->setBaseID(BaseObj_t::NOT_IN_DATABASE);
auto real_first=dynamic_cast<libIRDB::Instruction_t*>(first);
assert(real_first);
real_first->GetRelocations().clear();
......@@ -121,6 +124,9 @@ Instruction_t* IRDB_SDK::insertDataBitsBefore(FileIR_t* virp, Instruction_t* fir
next->setOriginalAddressID(first->getOriginalAddressID());
//"Null" out the original address (it should be as if the instruction was not in the database).
first->setOriginalAddressID(BaseObj_t::NOT_IN_DATABASE);
// Keep Base ID in the original instruction
next->setBaseID(first->getBaseID());
first->setBaseID(BaseObj_t::NOT_IN_DATABASE);
auto real_first=dynamic_cast<libIRDB::Instruction_t*>(first);
assert(real_first);
real_first->GetRelocations().clear();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment