aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2012-08-18 22:04:34 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2012-08-18 22:04:34 +0000
commita4b5717ea7ea09afeb5cda2683f6e91a802f5906 (patch)
tree0b728979e25757dca9af9aec599aa38e61d68f3b /lib/Transforms
parent0a8f8980000b753ef77dfc64cc7d9803d5dcc8ce (diff)
downloadexternal_llvm-a4b5717ea7ea09afeb5cda2683f6e91a802f5906.zip
external_llvm-a4b5717ea7ea09afeb5cda2683f6e91a802f5906.tar.gz
external_llvm-a4b5717ea7ea09afeb5cda2683f6e91a802f5906.tar.bz2
InstCombine: Fix a crasher when encountering a function pointer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162180 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/InstCombine/InstCombineCompares.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Transforms/InstCombine/InstCombineCompares.cpp b/lib/Transforms/InstCombine/InstCombineCompares.cpp
index c43fb71..c3fc18c 100644
--- a/lib/Transforms/InstCombine/InstCombineCompares.cpp
+++ b/lib/Transforms/InstCombine/InstCombineCompares.cpp
@@ -2990,7 +2990,7 @@ Instruction *InstCombiner::visitFCmpInst(FCmpInst &I) {
CallInst *CI = cast<CallInst>(LHSI);
LibFunc::Func Func;
// Various optimization for fabs compared with zero.
- if (RHSC->isNullValue() &&
+ if (RHSC->isNullValue() && CI->getCalledFunction() &&
TLI->getLibFunc(CI->getCalledFunction()->getName(), Func) &&
TLI->has(Func)) {
if (Func == LibFunc::fabs || Func == LibFunc::fabsf ||