diff options
author | Hiroshi Inoue <inouehrs@jp.ibm.com> | 2017-10-16 12:11:15 +0000 |
---|---|---|
committer | Hiroshi Inoue <inouehrs@jp.ibm.com> | 2017-10-16 12:11:15 +0000 |
commit | 41bfb49b40cfa3a33bdfe9073a6342edaab98868 (patch) | |
tree | af0e772a1e40e3b7a5cd9665197854fcbf39bcd1 /lib/Target/PowerPC/PPCInstrInfo.cpp | |
parent | ddb14f8532dc5b64fa4b83d54eb3625077751be7 (diff) |
[PowerPC] fix up in sign-/zero-extension elimination
This patch fixes a potential problem in my previous commit (https://reviews.llvm.org/rL315888) by adding a null check.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315900 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PowerPC/PPCInstrInfo.cpp')
-rw-r--r-- | lib/Target/PowerPC/PPCInstrInfo.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Target/PowerPC/PPCInstrInfo.cpp b/lib/Target/PowerPC/PPCInstrInfo.cpp index 9da20d9bc6f..b4da2d65596 100644 --- a/lib/Target/PowerPC/PPCInstrInfo.cpp +++ b/lib/Target/PowerPC/PPCInstrInfo.cpp @@ -2256,6 +2256,8 @@ PPCInstrInfo::isSignOrZeroExtended(const MachineInstr &MI, bool SignExt, if (CallMI.isCall() && CallMI.getOperand(0).isGlobal()) { const Function *CalleeFn = dyn_cast<Function>(CallMI.getOperand(0).getGlobal()); + if (!CalleeFn) + return false; const IntegerType *IntTy = dyn_cast<IntegerType>(CalleeFn->getReturnType()); const AttributeSet &Attrs = |