Skip to content
This repository was archived by the owner on Mar 28, 2020. It is now read-only.

Commit 245fddf

Browse files
committed
[CloneFunction] Don't crash if the value map doesn't hold something
It is possible for the value map to not have an entry for some value that has already been removed. I don't have a testcase, this is fall-out from a buildbot. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277614 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 3f2fe11 commit 245fddf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/Transforms/Utils/CloneFunction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ void llvm::CloneAndPruneIntoFromInst(Function *NewFunc, const Function *OldFunc,
562562
// Note that we must test the size on each iteration, the worklist can grow.
563563
for (unsigned Idx = 0; Idx != Worklist.size(); ++Idx) {
564564
const Value *OrigV = Worklist[Idx];
565-
auto *I = cast<Instruction>(VMap.lookup(OrigV));
565+
auto *I = cast_or_null<Instruction>(VMap.lookup(OrigV));
566566
if (!I)
567567
continue;
568568

0 commit comments

Comments
 (0)