Check for null pointer before dereferencing. A careless typo on my part.

I don't know why this did not show up earlier. This code has been
around for ages. 



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197119 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Reed Kotler 2013-12-12 02:41:11 +00:00
parent 24802f3f82
commit dcdc5736ad

View File

@ -2331,7 +2331,7 @@ getOpndList(SmallVectorImpl<SDValue> &Ops,
if (GlobalAddressSDNode *G = dyn_cast<GlobalAddressSDNode>(CLI.Callee)) {
llvm::StringRef Sym = G->getGlobal()->getName();
Function *F = G->getGlobal()->getParent()->getFunction(Sym);
if (F->hasFnAttribute("__Mips16RetHelper")) {
if (F && F->hasFnAttribute("__Mips16RetHelper")) {
Mask = MipsRegisterInfo::getMips16RetHelperMask();
}
}
@ -3262,7 +3262,7 @@ MipsTargetLowering::MipsCC::SpecialCallingConvType
if (GlobalAddressSDNode *G = dyn_cast<GlobalAddressSDNode>(Callee)) {
llvm::StringRef Sym = G->getGlobal()->getName();
Function *F = G->getGlobal()->getParent()->getFunction(Sym);
if (F->hasFnAttribute("__Mips16RetHelper")) {
if (F && F->hasFnAttribute("__Mips16RetHelper")) {
SpecialCallingConv = MipsCC::Mips16RetHelperConv;
}
}