GP-3150 Fix potential waffling of RETURN/BRANCH on pop of pc if bad

flows are present function flowing into another function.
This commit is contained in:
emteere 2023-03-18 18:11:56 +00:00
parent 61a2b8335c
commit 4443a7ab19
2 changed files with 10 additions and 1 deletions

View file

@ -95,6 +95,10 @@ public class ArmAnalyzer extends ConstantPropagationAnalyzer {
!instr.getFlowType().isTerminal()) {
// need to set the return override
instr.setFlowOverride(FlowOverride.RETURN);
// get rid of any references that might have been put on from
// bad flows
ReferenceManager refMgr = program.getReferenceManager();
refMgr.removeAllReferencesFrom(instr.getAddress());
}
}
// if LR is a constant and is set right after this, this is a call
@ -109,6 +113,10 @@ public class ArmAnalyzer extends ConstantPropagationAnalyzer {
if (hasDataReferenceTo(program, addr)) {
return false;
}
// if flow already over-ridden don't override again
if (instr.getFlowOverride() != FlowOverride.NONE) {
return false;
}
instr.setFlowOverride(FlowOverride.CALL);
// need to trigger disassembly below! if not already
doArmThumbDisassembly(program, instr, context, addr,