aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Target/X86/X86ISelLowering.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp
index e27d93cf7c..e272d9b92a 100644
--- a/lib/Target/X86/X86ISelLowering.cpp
+++ b/lib/Target/X86/X86ISelLowering.cpp
@@ -2270,7 +2270,8 @@ X86TargetLowering::IsEligibleForTailCallOptimization(SDValue Callee,
return false;
// If it's an indirect call, conversatively return false if the caller's
// address is taken.
- if (!isa<ExternalSymbolSDNode>(Callee) && CallerF->hasAddressTaken())
+ if (!CalleeF &&
+ !isa<ExternalSymbolSDNode>(Callee) && CallerF->hasAddressTaken())
return false;
// Look for obvious safe cases to perform tail call optimization.