Unverified Commit 78575b7b by Enkelmann Committed by GitHub

Bugfix: prevent creation of duplicated block term (#343)

parent f81403a4
...@@ -211,7 +211,10 @@ public final class JumpProcessing { ...@@ -211,7 +211,10 @@ public final class JumpProcessing {
public static void addMissingJumpAfterInstructionSplit(Term<Blk> lastBlock) { public static void addMissingJumpAfterInstructionSplit(Term<Blk> lastBlock) {
lastBlock.getTerm().addMultipleDefs(PcodeBlockData.temporaryDefStorage); lastBlock.getTerm().addMultipleDefs(PcodeBlockData.temporaryDefStorage);
addBranchToCurrentBlock(lastBlock.getTerm(), PcodeBlockData.instruction.getAddress().toString(), PcodeBlockData.instruction.getFallThrough().toString()); addBranchToCurrentBlock(lastBlock.getTerm(), PcodeBlockData.instruction.getAddress().toString(), PcodeBlockData.instruction.getFallThrough().toString());
PcodeBlockData.blocks.add(TermCreator.createBlkTerm(PcodeBlockData.instruction.getFallThrough().toString(), null)); // If and only if the jump target is still part of the same Ghidra block, we need to start a new block term for it.
if (PcodeBlockData.instructionIndex != PcodeBlockData.numberOfInstructionsInBlock - 1) {
PcodeBlockData.blocks.add(TermCreator.createBlkTerm(PcodeBlockData.instruction.getFallThrough().toString(), null));
}
PcodeBlockData.temporaryDefStorage.clear(); PcodeBlockData.temporaryDefStorage.clear();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment