aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/DataStructure/Local.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Analysis/DataStructure/Local.cpp')
-rw-r--r--lib/Analysis/DataStructure/Local.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/Analysis/DataStructure/Local.cpp b/lib/Analysis/DataStructure/Local.cpp
index dbf182d98c..64e6088e7c 100644
--- a/lib/Analysis/DataStructure/Local.cpp
+++ b/lib/Analysis/DataStructure/Local.cpp
@@ -443,8 +443,14 @@ void GraphBuilder::visitCallSite(CallSite CS) {
RetVal = getValueDest(*I);
DSNode *Callee = 0;
- if (DisableDirectCallOpt || !isa<Function>(CS.getCalledValue()))
+ if (DisableDirectCallOpt || !isa<Function>(CS.getCalledValue())) {
Callee = getValueDest(*CS.getCalledValue()).getNode();
+ if (Callee == 0) {
+ std::cerr << "WARNING: Program is calling through a null pointer?\n"
+ << *I;
+ return; // Calling a null pointer?
+ }
+ }
std::vector<DSNodeHandle> Args;
Args.reserve(CS.arg_end()-CS.arg_begin());