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

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

lib/Analysis/MemorySSAUpdater.cpp

index e0b27f1d501b586b28bee97c9207e10cad5fc328..6018968c199d7fd1ad5e0d3bafc87a7549cb0d08 100644 (file)
@@ -1082,7 +1082,7 @@ void MemorySSAUpdater::applyInsertUpdates(ArrayRef<CFGUpdate> Updates,
         for (; UI != E;) {
           Use &U = *UI;
           ++UI;
-          MemoryAccess *Usr = dyn_cast<MemoryAccess>(U.getUser());
+          MemoryAccess *Usr = cast<MemoryAccess>(U.getUser());
           if (MemoryPhi *UsrPhi = dyn_cast<MemoryPhi>(Usr)) {
             BasicBlock *DominatedBlock = UsrPhi->getIncomingBlock(U);
             if (!DT.dominates(DominatingBlock, DominatedBlock))