]> granicus.if.org Git - llvm/commitdiff
BasicAA: Uninserted instructions have no parent, and notDifferentParent explicitly...
authorDaniel Berlin <dberlin@dberlin.org>
Fri, 19 May 2017 19:01:21 +0000 (19:01 +0000)
committerDaniel Berlin <dberlin@dberlin.org>
Fri, 19 May 2017 19:01:21 +0000 (19:01 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303442 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/BasicAliasAnalysis.cpp

index a33c01a0e461ebb1e2355e8e909c0f39a0ec3bfa..f743cb234c455f0a5d05603510b31fccc409c6aa 100644 (file)
@@ -683,8 +683,11 @@ static bool isIntrinsicCall(ImmutableCallSite CS, Intrinsic::ID IID) {
 
 #ifndef NDEBUG
 static const Function *getParent(const Value *V) {
-  if (const Instruction *inst = dyn_cast<Instruction>(V))
+  if (const Instruction *inst = dyn_cast<Instruction>(V)) {
+    if (!inst->getParent())
+      return nullptr;
     return inst->getParent()->getParent();
+  }
 
   if (const Argument *arg = dyn_cast<Argument>(V))
     return arg->getParent();