aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Analysis
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-09-24 23:42:58 +0000
committerChris Lattner <sabre@nondot.org>2003-09-24 23:42:58 +0000
commitfbc2d84ce9c3ff97a1644b864a2057f8d02179ab (patch)
tree346a4087778e8ee78598c4a7997504ca6ef23495 /lib/Analysis
parent4eed793d5a3489a65aee8f31f9a099b33868d96b (diff)
downloadexternal_llvm-fbc2d84ce9c3ff97a1644b864a2057f8d02179ab.zip
external_llvm-fbc2d84ce9c3ff97a1644b864a2057f8d02179ab.tar.gz
external_llvm-fbc2d84ce9c3ff97a1644b864a2057f8d02179ab.tar.bz2
DOn't crash if program calls the null pointer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8708 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-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 dbf182d..64e6088 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());