summaryrefslogtreecommitdiff
path: root/lib/Target/Mips/MipsISelLowering.cpp
diff options
context:
space:
mode:
authorReed Kotler <rkotler@mips.com>2013-12-12 02:41:11 +0000
committerReed Kotler <rkotler@mips.com>2013-12-12 02:41:11 +0000
commitdcdc5736ad62ad2ba62419e8d311d883cee1a329 (patch)
treebb2fccdf92a8bda9d1954be85cb239bbe9b13691 /lib/Target/Mips/MipsISelLowering.cpp
parent24802f3f82bade50b686efb368cfb01a8bb0264f (diff)
downloadllvm-dcdc5736ad62ad2ba62419e8d311d883cee1a329.tar.gz
llvm-dcdc5736ad62ad2ba62419e8d311d883cee1a329.tar.bz2
llvm-dcdc5736ad62ad2ba62419e8d311d883cee1a329.tar.xz
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
Diffstat (limited to 'lib/Target/Mips/MipsISelLowering.cpp')
-rw-r--r--lib/Target/Mips/MipsISelLowering.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Target/Mips/MipsISelLowering.cpp b/lib/Target/Mips/MipsISelLowering.cpp
index b1a25dd463..8f3c264907 100644
--- a/lib/Target/Mips/MipsISelLowering.cpp
+++ b/lib/Target/Mips/MipsISelLowering.cpp
@@ -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;
}
}