]> granicus.if.org Git - llvm/commitdiff
LowerExpectIntrinsic handlePhiDef - silence static analyzer dyn_cast<PHINode> null...
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 2 Oct 2019 16:03:45 +0000 (16:03 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 2 Oct 2019 16:03:45 +0000 (16:03 +0000)
The static analyzer is warning about a potential null dereference, but we should be able to use cast<PHINode> directly and if not assert will fire for us.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373481 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/LowerExpectIntrinsic.cpp

index cdb1d79066773f32120f294f48403f6a4bccc6b0..d85f20b3f80c101bdb8ce3192a60d5203a989ae0 100644 (file)
@@ -161,7 +161,7 @@ static void handlePhiDef(CallInst *Expect) {
     return Result;
   };
 
-  auto *PhiDef = dyn_cast<PHINode>(V);
+  auto *PhiDef = cast<PHINode>(V);
 
   // Get the first dominating conditional branch of the operand
   // i's incoming block.