From bfdc0337047b4c8546c6083026e4b255f306f946 Mon Sep 17 00:00:00 2001 From: Christoph Egger Date: Tue, 3 Jun 2014 19:02:17 +0200 Subject: [PATCH] Always add following blocks even if it is already created If the jump target already existed it was not even registered --- src/disassembler/llvm/LLVMDisassembler.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/disassembler/llvm/LLVMDisassembler.cxx b/src/disassembler/llvm/LLVMDisassembler.cxx index e96f0ba..1067fcc 100644 --- a/src/disassembler/llvm/LLVMDisassembler.cxx +++ b/src/disassembler/llvm/LLVMDisassembler.cxx @@ -193,18 +193,18 @@ void LLVMDisassembler::disassemble() { remaining_functions.push(fun); } } else { + current_block->setNextBlock(0, jmptarget); if (blocks.find(jmptarget) == blocks.end()) { LLVMBasicBlock * block = new LLVMBasicBlock(jmptarget, this); blocks.insert(std::make_pair(block->getStartAddress(), block)); - current_block->setNextBlock(0, block->getStartAddress()); remaining_blocks.push(block); } if (MIA->isConditionalBranch(inst)) { jmptarget = base_address + current_address + inst_size; + current_block->setNextBlock(1, jmptarget); if (blocks.find(jmptarget) == blocks.end()) { LLVMBasicBlock * block = new LLVMBasicBlock(jmptarget, this); blocks.insert(std::make_pair(block->getStartAddress(), block)); - current_block->setNextBlock(1, block->getStartAddress()); remaining_blocks.push(block); } } -- 2.39.5