Fix a crasher: we need to check that the function is non-null before using it!
authorOwen Anderson <resistor@mac.com>
Fri, 6 Feb 2009 00:13:43 +0000 (00:13 +0000)
committerOwen Anderson <resistor@mac.com>
Fri, 6 Feb 2009 00:13:43 +0000 (00:13 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63902 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/AliasAnalysis.cpp

index 3d1b20bba7a0181d189ee4e09c68f0151f36fa8e..369f2f4f90e1e3f30f8d9c22ce11a60ced048068 100644 (file)
@@ -120,7 +120,7 @@ AliasAnalysis::getModRefBehavior(CallSite CS,
 AliasAnalysis::ModRefBehavior
 AliasAnalysis::getModRefBehavior(Function *F,
                                  std::vector<PointerAccessInfo> *Info) {
-  if (F->doesNotAccessMemory())
+  if (F && F->doesNotAccessMemory())
     // Can't do better than this.
     return DoesNotAccessMemory;
   return UnknownModRefBehavior;