Fix FunctionStartAnalyzer's control flow

The continue keyword has no effect, when it should be breaking out of both loops to the outer one.
This commit is contained in:
Wiz 2021-12-21 00:45:08 -05:00
parent da8c3643e2
commit d8bf2f9875

View File

@ -718,14 +718,8 @@ public class FunctionStartAnalyzer extends AbstractAnalyzer implements PatternFa
while (addresses.hasNext() && !addedMonitor.isCancelled()) {
Address address = addresses.next();
// if there are any conditional references, then this can't be a function start
ReferenceIterator referencesTo =
addedProgram.getReferenceManager().getReferencesTo(address);
while (referencesTo.hasNext()) {
Reference reference = referencesTo.next();
if (reference.getReferenceType().isConditional()) {
continue;
}
if (hasConditionalReferences(addedProgram, address)) {
continue;
}
Function funcAt =
addedProgram.getFunctionManager().getFunctionContaining(address);
@ -743,6 +737,18 @@ public class FunctionStartAnalyzer extends AbstractAnalyzer implements PatternFa
}
return true;
}
private boolean hasConditionalReferences(Program addedProgram, Address address) {
ReferenceIterator refsTo =
addedProgram.getReferenceManager().getReferencesTo(address);
while (refsTo.hasNext()) {
Reference reference = refsTo.next();
if (reference.getReferenceType().isConditional()) {
return true;
}
}
return false;
}
}, potentialFuncResult);
}