mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-14 23:29:51 +00:00
DOn't crash if program calls the null pointer
llvm-svn: 8708
This commit is contained in:
parent
6d9f1022d5
commit
471405e2ba
@ -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());
|
||||
|
Loading…
Reference in New Issue
Block a user