diff options
author | Reid Kleckner <rnk@google.com> | 2017-10-13 16:55:14 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2017-10-13 16:55:14 +0000 |
commit | 65fa869c233fef855606cbbe90d3ede44b5bb8cf (patch) | |
tree | d24eadef36d5139e580e83aca548e4042063973e /clang/lib/CodeGen/CGException.cpp | |
parent | df9611e17839419ae653415cf0a42dc22dd57f23 (diff) | |
download | llvm-65fa869c233fef855606cbbe90d3ede44b5bb8cf.zip llvm-65fa869c233fef855606cbbe90d3ede44b5bb8cf.tar.gz llvm-65fa869c233fef855606cbbe90d3ede44b5bb8cf.tar.bz2 |
[SEH] Use the SEH personality on frontend-outlined funclets
This allows __try inside __finally to work.
Fixes PR34939
llvm-svn: 315707
Diffstat (limited to 'clang/lib/CodeGen/CGException.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGException.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGException.cpp b/clang/lib/CodeGen/CGException.cpp index 709ed00..1bff649 100644 --- a/clang/lib/CodeGen/CGException.cpp +++ b/clang/lib/CodeGen/CGException.cpp @@ -225,7 +225,12 @@ const EHPersonality &EHPersonality::get(CodeGenModule &CGM, } const EHPersonality &EHPersonality::get(CodeGenFunction &CGF) { - return get(CGF.CGM, dyn_cast_or_null<FunctionDecl>(CGF.CurCodeDecl)); + const auto *FD = CGF.CurCodeDecl; + // For outlined finallys and filters, use the SEH personality in case they + // contain more SEH. This mostly only affects finallys. Filters could + // hypothetically use gnu statement expressions to sneak in nested SEH. + FD = FD ? FD : CGF.CurSEHParent; + return get(CGF.CGM, dyn_cast_or_null<FunctionDecl>(FD)); } static llvm::Constant *getPersonalityFn(CodeGenModule &CGM, |