mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-06 12:00:04 +02:00
GT-3511 corrected infinite loop is disassembler caused by branch to self
with nested delay slot failure
This commit is contained in:
parent
0c30c72274
commit
e3e56fa29c
1 changed files with 8 additions and 5 deletions
|
@ -79,8 +79,8 @@ class DisassemblerQueue {
|
||||||
currentBranchQueue = new TreeSet<InstructionBlockFlow>(ORDERED_FLOW_COMPARATOR);
|
currentBranchQueue = new TreeSet<InstructionBlockFlow>(ORDERED_FLOW_COMPARATOR);
|
||||||
processedBranchFlows = new HashSet<InstructionBlockFlow>(48);
|
processedBranchFlows = new HashSet<InstructionBlockFlow>(48);
|
||||||
|
|
||||||
orderedSeedQueue.add(new InstructionBlockFlow(startAddr, null,
|
orderedSeedQueue.add(
|
||||||
InstructionBlockFlow.Type.PRIORITY));
|
new InstructionBlockFlow(startAddr, null, InstructionBlockFlow.Type.PRIORITY));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -174,6 +174,9 @@ class DisassemblerQueue {
|
||||||
branchFlow = currentBranchQueue.first();
|
branchFlow = currentBranchQueue.first();
|
||||||
currentBranchQueue.remove(branchFlow);
|
currentBranchQueue.remove(branchFlow);
|
||||||
}
|
}
|
||||||
|
if (processedBranchFlows.contains(branchFlow)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
processedBranchFlows.add(branchFlow);
|
processedBranchFlows.add(branchFlow);
|
||||||
|
|
||||||
Address blockAddr = branchFlow.getDestinationAddress();
|
Address blockAddr = branchFlow.getDestinationAddress();
|
||||||
|
@ -232,8 +235,8 @@ class DisassemblerQueue {
|
||||||
if (flowType != Type.CALL && processedBranchFlows.contains(blockFlow)) {
|
if (flowType != Type.CALL && processedBranchFlows.contains(blockFlow)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (conflict == null ||
|
if (conflict == null || conflict.getInstructionAddress().compareTo(
|
||||||
conflict.getInstructionAddress().compareTo(blockFlow.getFlowFromAddress()) > 0) {
|
blockFlow.getFlowFromAddress()) > 0) {
|
||||||
// Add good flows to priorityBranchSet to ensure that future context is
|
// Add good flows to priorityBranchSet to ensure that future context is
|
||||||
// properly consumed with a guaranteed block start. We don't
|
// properly consumed with a guaranteed block start. We don't
|
||||||
// want block to be dependent upon a parent block
|
// want block to be dependent upon a parent block
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue