mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-21 18:24:23 +00:00
DataFlowSanitizer: fix a use-after-free. Spotted by libgmalloc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188216 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -422,9 +422,12 @@ bool DataFlowSanitizer::runOnModule(Module &M) {
|
|||||||
// instruction's next pointer and moving the next instruction to the
|
// instruction's next pointer and moving the next instruction to the
|
||||||
// tail block from which we should continue.
|
// tail block from which we should continue.
|
||||||
Instruction *Next = Inst->getNextNode();
|
Instruction *Next = Inst->getNextNode();
|
||||||
|
// DFSanVisitor may delete Inst, so keep track of whether it was a
|
||||||
|
// terminator.
|
||||||
|
bool IsTerminator = isa<TerminatorInst>(Inst);
|
||||||
if (!DFSF.SkipInsts.count(Inst))
|
if (!DFSF.SkipInsts.count(Inst))
|
||||||
DFSanVisitor(DFSF).visit(Inst);
|
DFSanVisitor(DFSF).visit(Inst);
|
||||||
if (isa<TerminatorInst>(Inst))
|
if (IsTerminator)
|
||||||
break;
|
break;
|
||||||
Inst = Next;
|
Inst = Next;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user