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. 

llvm-svn: 197119
This commit is contained in:
Reed Kotler 2013-12-12 02:41:11 +00:00
parent bf6dda5116
commit 3230e725aa
1 changed files with 2 additions and 2 deletions

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;
}
}