mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-09 05:57:23 +00:00
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
This commit is contained in:
parent
4eed793d5a
commit
fbc2d84ce9
@ -443,8 +443,14 @@ void GraphBuilder::visitCallSite(CallSite CS) {
|
|||||||
RetVal = getValueDest(*I);
|
RetVal = getValueDest(*I);
|
||||||
|
|
||||||
DSNode *Callee = 0;
|
DSNode *Callee = 0;
|
||||||
if (DisableDirectCallOpt || !isa<Function>(CS.getCalledValue()))
|
if (DisableDirectCallOpt || !isa<Function>(CS.getCalledValue())) {
|
||||||
Callee = getValueDest(*CS.getCalledValue()).getNode();
|
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;
|
std::vector<DSNodeHandle> Args;
|
||||||
Args.reserve(CS.arg_end()-CS.arg_begin());
|
Args.reserve(CS.arg_end()-CS.arg_begin());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user