From 25eb165f18a6479bcae7bcb338b22a2bfc4290fd Mon Sep 17 00:00:00 2001 From: David Majnemer Date: Tue, 1 Mar 2016 19:42:53 +0000 Subject: [MSVC Compat] Correctly handle finallys nested within finallys We'd lose track of the parent CodeGenFunction, leading us to get confused with regard to which function a nested finally belonged to. Differential Revision: http://reviews.llvm.org/D17752 llvm-svn: 262379 --- clang/lib/CodeGen/CodeGenFunction.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp') diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index 8e327c2..0e118b8 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -669,6 +669,9 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, DidCallStackSave = false; CurCodeDecl = D; + if (const auto *FD = dyn_cast_or_null(D)) + if (FD->usesSEHTry()) + CurSEHParent = FD; CurFuncDecl = (D ? D->getNonClosureContext() : nullptr); FnRetTy = RetTy; CurFn = Fn; -- cgit v1.1