mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-08 04:11:27 +00:00
DataFlowSanitizer: fix a use-after-free. Spotted by libgmalloc.
llvm-svn: 188216
This commit is contained in:
parent
9f798c877d
commit
10cbe4a9bb
@ -422,9 +422,12 @@ bool DataFlowSanitizer::runOnModule(Module &M) {
|
||||
// instruction's next pointer and moving the next instruction to the
|
||||
// tail block from which we should continue.
|
||||
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))
|
||||
DFSanVisitor(DFSF).visit(Inst);
|
||||
if (isa<TerminatorInst>(Inst))
|
||||
if (IsTerminator)
|
||||
break;
|
||||
Inst = Next;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user