mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
EFA: update Block.End when appropriate
This change handle the situation in which getLastPC returns an invalid MetaAddress. This is a new behavior introduce to handle queries on `llvm::BasicBlock`s whose last PC is ambiguous.
This commit is contained in:
@@ -1068,6 +1068,7 @@ FunctionEntrypointAnalyzer::collectDirectCFG(OutlinedFunction *F) {
|
||||
MetaAddress Start = getBasicBlockPC(&BB);
|
||||
efa::BasicBlock Block{ Start };
|
||||
Block.End = getFinalAddressOfBasicBlock(&BB);
|
||||
revng_assert(Block.End.isValid());
|
||||
|
||||
OnceQueue<BasicBlock *> Queue;
|
||||
Queue.insert(&BB);
|
||||
@@ -1082,7 +1083,7 @@ FunctionEntrypointAnalyzer::collectDirectCFG(OutlinedFunction *F) {
|
||||
BasicBlock *Current = Queue.pop();
|
||||
|
||||
MetaAddress CurrentBlockEnd = getFinalAddressOfBasicBlock(Current);
|
||||
if (CurrentBlockEnd > Block.End)
|
||||
if (CurrentBlockEnd.isValid() and CurrentBlockEnd > Block.End)
|
||||
Block.End = CurrentBlockEnd;
|
||||
|
||||
for (BasicBlock *Succ : successors(Current)) {
|
||||
|
||||
Reference in New Issue
Block a user