]> git.siccegge.de Git - frida/frida.git/commitdiff
Always add following blocks even if it is already created
authorChristoph Egger <siccegge@cs.fau.de>
Tue, 3 Jun 2014 17:02:17 +0000 (19:02 +0200)
committerChristoph Egger <siccegge@cs.fau.de>
Tue, 3 Jun 2014 17:02:17 +0000 (19:02 +0200)
If the jump target already existed it was not even registered

src/disassembler/llvm/LLVMDisassembler.cxx

index e96f0baae1cc32c271b344cc822e53612d177dba..1067fcc1f02bebcefd01969fbd99142902a59c54 100644 (file)
@@ -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);
                                     }
                                 }