summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2015-07-01 16:45:47 +0000
committerReid Kleckner <reid@kleckner.net>2015-07-01 16:45:47 +0000
commitf80636682ce2b1588ba3e04fa4ebfd00adac969a (patch)
treedbd3df25100d09a3911a1b4fd84bc51e36d6035e /llvm/lib/Target
parent286d466097d445b66be8453596fd3e128e37dc9a (diff)
downloadbcm5719-llvm-f80636682ce2b1588ba3e04fa4ebfd00adac969a.tar.gz
bcm5719-llvm-f80636682ce2b1588ba3e04fa4ebfd00adac969a.zip
[SEH] Don't assert if the parent function lacks a personality
The EH code might have been deleted as unreachable and the personality pruned while the filter is still present. Currently I'm hitting this at -O0 due to the clang bug PR24009. llvm-svn: 241170
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/X86/X86ISelLowering.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index 6d4f817ad67..eab9e0fbe5b 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -15011,6 +15011,12 @@ static SDValue recoverFramePointer(SelectionDAG &DAG, const Function *Fn,
const TargetLowering &TLI = DAG.getTargetLoweringInfo();
MVT PtrVT = TLI.getPointerTy();
+ // It's possible that the parent function no longer has a personality function
+ // if the exceptional code was optimized away, in which case we just return
+ // the incoming EBP.
+ if (!Fn->hasPersonalityFn())
+ return EntryEBP;
+
// The RegNodeSize is 6 32-bit words for SEH and 4 for C++ EH. See
// WinEHStatePass for the full struct definition.
int RegNodeSize;
OpenPOWER on IntegriCloud