Fix a silly bug that Nicholas noticed.
authorOwen Anderson <resistor@mac.com>
Mon, 26 Nov 2007 03:27:38 +0000 (03:27 +0000)
committerOwen Anderson <resistor@mac.com>
Mon, 26 Nov 2007 03:27:38 +0000 (03:27 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44324 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/MemoryDependenceAnalysis.cpp

index 68366f6d912dcaf17ef11c18f5482aa6bd224e3e..dd567aac95dc35c854963a226940f30b96158b74 100644 (file)
@@ -94,7 +94,8 @@ Instruction* MemoryDependenceAnalysis::getCallSiteDependency(CallSite C,
       
       // 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));