From 91ea4ffcd0f6983124a59b59670f8f2a35d1343d Mon Sep 17 00:00:00 2001 From: Christoph Egger Date: Tue, 27 May 2014 13:21:36 +0200 Subject: [PATCH] Use target addresses for basic block linking --- src/disassembler/BasicBlock.hxx | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/disassembler/BasicBlock.hxx b/src/disassembler/BasicBlock.hxx index c994d9e..1952f2b 100644 --- a/src/disassembler/BasicBlock.hxx +++ b/src/disassembler/BasicBlock.hxx @@ -1,9 +1,14 @@ #ifndef INCLUDE__BasicBlock_hxx #define INCLUDE__BasicBlock_hxx +#include + class BasicBlock { public: - BasicBlock() {} + BasicBlock() { + next_blocks[0] = 0; + next_blocks[1] = 0; + } uint64_t getStartAddress() const { return start_address; @@ -13,8 +18,14 @@ public: return end_address; } - BasicBlock * const * getNextBlocks() const { - return next_blocks; + uint64_t getNextBlock(size_t index) const { + assert(index < 2); + return next_blocks[index]; + } + + void setNextBlock(size_t index, uint64_t address) { + assert(index < 2); + next_blocks[index] = address; } void setStartAddress(uint64_t address) { @@ -29,7 +40,7 @@ private: uint64_t start_address; uint64_t end_address; - BasicBlock * next_blocks[2]; + uint64_t next_blocks[2]; }; #endif -- 2.39.5