diff options
author | Eli Friedman <efriedma@quicinc.com> | 2022-11-16 15:13:33 -0800 |
---|---|---|
committer | Eli Friedman <efriedma@quicinc.com> | 2022-11-16 15:13:33 -0800 |
commit | 0fcb26c5b6487bf9b31670122f8c931ac020bb34 (patch) | |
tree | 2994994a8fa50cc3a7a3474c674d1119f9fee5cc /clang/lib/CodeGen/CodeGenFunction.cpp | |
parent | 55f56cdc3329b9af059caf7fd5df01fe4e54eb14 (diff) | |
download | llvm-0fcb26c5b6487bf9b31670122f8c931ac020bb34.zip llvm-0fcb26c5b6487bf9b31670122f8c931ac020bb34.tar.gz llvm-0fcb26c5b6487bf9b31670122f8c931ac020bb34.tar.bz2 |
[clang] Fix __try/__finally blocks in C++ constructors.
We were crashing trying to convert a GlobalDecl from a
CXXConstructorDecl. Instead of trying to do that conversion, just pass
down the original GlobalDecl.
I think we could actually compute the correct constructor/destructor
kind from the context, given the way Microsoft mangling works, but it's
simpler to just pass through the correct constructor/destructor kind.
Differential Revision: https://reviews.llvm.org/D136776
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index 62e58b3..9a1ae23 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -701,7 +701,7 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, QualType RetTy, CurCodeDecl = D; const FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(D); if (FD && FD->usesSEHTry()) - CurSEHParent = FD; + CurSEHParent = GD; CurFuncDecl = (D ? D->getNonClosureContext() : nullptr); FnRetTy = RetTy; CurFn = Fn; |