Fix a silly bug that Nicholas noticed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44324 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/MemoryDependenceAnalysis.cpp b/lib/Analysis/MemoryDependenceAnalysis.cpp
index 68366f6..dd567aa 100644
--- a/lib/Analysis/MemoryDependenceAnalysis.cpp
+++ b/lib/Analysis/MemoryDependenceAnalysis.cpp
@@ -94,7 +94,8 @@
// FreeInsts erase the entire structure
pointerSize = ~0UL;
- } else if (CallSite::get(QI).getInstruction() != 0) {
+ } else if (CallSite::get(QI).getInstruction() != 0 &&
+ cast<CallInst>(QI)->getCalledFunction()) {
AliasAnalysis::ModRefBehavior result =
AA.getModRefBehavior(cast<CallInst>(QI)->getCalledFunction(),
CallSite::get(QI));