Merge remote-tracking branch 'origin/GP-3044_emteere_sharedReturnFix--SQUASHED'

This commit is contained in:
Ryan Kurtz 2023-04-21 12:00:55 -04:00
commit 17ad8c3a47

View file

@ -68,7 +68,7 @@ public class SharedReturnAnalysisCmd extends BackgroundCommand {
SymbolTable symbolTable = program.getSymbolTable();
SymbolIterator fnSymbols = symbolTable.getSymbols(set, SymbolType.FUNCTION, true);
while (fnSymbols.hasNext()) {
monitor.checkCanceled();
monitor.checkCancelled();
Symbol s = fnSymbols.next();
Address entry = s.getAddress();
@ -82,7 +82,7 @@ public class SharedReturnAnalysisCmd extends BackgroundCommand {
fnSymbols = symbolTable.getSymbols(set, SymbolType.FUNCTION, true);
while (fnSymbols.hasNext()) {
monitor.checkCanceled();
monitor.checkCancelled();
Symbol s = fnSymbols.next();
checkAboveFunction(s, jumpScanSet);
checkBelowFunction(s, jumpScanSet);
@ -96,7 +96,7 @@ public class SharedReturnAnalysisCmd extends BackgroundCommand {
ReferenceManager refMgr = program.getReferenceManager();
AddressIterator refSrcIter = refMgr.getReferenceSourceIterator(jumpScanSet, true);
while (refSrcIter.hasNext()) {
monitor.checkCanceled();
monitor.checkCancelled();
Address srcAddr = refSrcIter.next();
RefType flow = null;
Address destAddr = null;
@ -283,7 +283,10 @@ public class SharedReturnAnalysisCmd extends BackgroundCommand {
if (fallFrom != null) {
Instruction fallInstr = program.getListing().getInstructionContaining(fallFrom);
if (fallInstr != null && location.equals(fallInstr.getFallThrough())) {
return true;
// if there is a function above, then it falls into this routine
if (program.getFunctionManager().getFunctionContaining(fallFrom) != null) {
return true;
}
}
}
return false;
@ -341,7 +344,7 @@ public class SharedReturnAnalysisCmd extends BackgroundCommand {
InstructionIterator instructionIter = program.getListing().getInstructions(set, true);
while (instructionIter.hasNext()) {
monitor.checkCanceled();
monitor.checkCancelled();
Instruction instr = instructionIter.next();
FlowType ft = instr.getFlowType();
if (!ft.isJump()) {
@ -371,11 +374,6 @@ public class SharedReturnAnalysisCmd extends BackgroundCommand {
private void processFunctionJumpReferences(Program program, Address entry, TaskMonitor monitor)
throws CancelledException {
// check if there is any fallthru flow to the entry point
if (hasFallThruTo(program, entry)) {
return;
}
// since reference fixup will occur when flow override is done,
// avoid concurrent modification during reference iterator use
// by building list of jump references
@ -387,7 +385,7 @@ public class SharedReturnAnalysisCmd extends BackgroundCommand {
FunctionManager funcMgr = program.getFunctionManager();
for (Reference ref : fnRefList) {
monitor.checkCanceled();
monitor.checkCancelled();
Instruction instr = program.getListing().getInstructionAt(ref.getFromAddress());
if (instr == null) {
continue;
@ -429,7 +427,7 @@ public class SharedReturnAnalysisCmd extends BackgroundCommand {
List<Reference> fnRefList = null;
ReferenceIterator referencesTo = program.getReferenceManager().getReferencesTo(entry);
while (referencesTo.hasNext()) {
monitor.checkCanceled();
monitor.checkCancelled();
Reference ref = referencesTo.next();
if (!ref.getReferenceType().isJump()) {
continue;