From: Christoph Egger Date: Tue, 3 Jun 2014 17:02:17 +0000 (+0200) Subject: Always add following blocks even if it is already created X-Git-Tag: v0.1~176 X-Git-Url: https://git.siccegge.de//index.cgi?a=commitdiff_plain;h=bfdc0337047b4c8546c6083026e4b255f306f946;p=frida%2Ffrida.git Always add following blocks even if it is already created If the jump target already existed it was not even registered --- 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); } }