summaryrefslogtreecommitdiffstats
path: root/llvm
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
commit66a473371f9324ca0c858ba1bcd4000ed88ad9d2 (patch)
treef9b458a9377f9c9cc8f3a71193cbc2410c97f5dc /llvm
parentce6feda7993c277a039b330f11535b154ac79ccc (diff)
downloadbcm5719-llvm-66a473371f9324ca0c858ba1bcd4000ed88ad9d2.tar.gz
bcm5719-llvm-66a473371f9324ca0c858ba1bcd4000ed88ad9d2.zip
DOn't crash if program calls the null pointer
llvm-svn: 8708
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/Analysis/DataStructure/Local.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/DataStructure/Local.cpp b/llvm/lib/Analysis/DataStructure/Local.cpp
index dbf182d98c1..64e6088e7c6 100644
--- a/llvm/lib/Analysis/DataStructure/Local.cpp
+++ b/llvm/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());
OpenPOWER on IntegriCloud