This revision was not accepted when it landed; it landed in state "Needs Review". This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGc4adc49a1c98: [SEH] Fix regression with SEH in noexpect functions (authored by ogoffart, committed by rnk).
Changed prior to commit: https://reviews.llvm.org/D102027?vs=343502&id=343753#toc Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D102027/new/ https://reviews.llvm.org/D102027 Files: clang/lib/CodeGen/CGException.cpp clang/lib/CodeGen/CGExpr.cpp clang/test/CodeGenCXX/exceptions-seh.cpp Index: clang/test/CodeGenCXX/exceptions-seh.cpp =================================================================== --- clang/test/CodeGenCXX/exceptions-seh.cpp +++ clang/test/CodeGenCXX/exceptions-seh.cpp @@ -164,3 +164,5 @@ // CHECK: store i32 1234, i32* @my_unique_global // CHECK: attributes #[[NOINLINE]] = { {{.*noinline.*}} } + +void seh_in_noexcept() noexcept { __try {} __finally {} } Index: clang/lib/CodeGen/CGExpr.cpp =================================================================== --- clang/lib/CodeGen/CGExpr.cpp +++ clang/lib/CodeGen/CGExpr.cpp @@ -4185,8 +4185,10 @@ /// Given that we are currently emitting a lambda, emit an l-value for /// one of its members. LValue CodeGenFunction::EmitLValueForLambdaField(const FieldDecl *Field) { - assert(cast<CXXMethodDecl>(CurCodeDecl)->getParent()->isLambda()); - assert(cast<CXXMethodDecl>(CurCodeDecl)->getParent() == Field->getParent()); + if (CurCodeDecl) { + assert(cast<CXXMethodDecl>(CurCodeDecl)->getParent()->isLambda()); + assert(cast<CXXMethodDecl>(CurCodeDecl)->getParent() == Field->getParent()); + } QualType LambdaTagType = getContext().getTagDeclType(Field->getParent()); LValue LambdaLV = MakeNaturalAlignAddrLValue(CXXABIThisValue, LambdaTagType); Index: clang/lib/CodeGen/CGException.cpp =================================================================== --- clang/lib/CodeGen/CGException.cpp +++ clang/lib/CodeGen/CGException.cpp @@ -1966,7 +1966,6 @@ StartFunction(GlobalDecl(), RetTy, Fn, FnInfo, Args, OutlinedStmt->getBeginLoc(), OutlinedStmt->getBeginLoc()); CurSEHParent = ParentCGF.CurSEHParent; - CurCodeDecl = ParentCGF.CurCodeDecl; CGM.SetInternalFunctionAttributes(GlobalDecl(), CurFn, FnInfo); EmitCapturedLocals(ParentCGF, OutlinedStmt, IsFilter);
Index: clang/test/CodeGenCXX/exceptions-seh.cpp =================================================================== --- clang/test/CodeGenCXX/exceptions-seh.cpp +++ clang/test/CodeGenCXX/exceptions-seh.cpp @@ -164,3 +164,5 @@ // CHECK: store i32 1234, i32* @my_unique_global // CHECK: attributes #[[NOINLINE]] = { {{.*noinline.*}} } + +void seh_in_noexcept() noexcept { __try {} __finally {} } Index: clang/lib/CodeGen/CGExpr.cpp =================================================================== --- clang/lib/CodeGen/CGExpr.cpp +++ clang/lib/CodeGen/CGExpr.cpp @@ -4185,8 +4185,10 @@ /// Given that we are currently emitting a lambda, emit an l-value for /// one of its members. LValue CodeGenFunction::EmitLValueForLambdaField(const FieldDecl *Field) { - assert(cast<CXXMethodDecl>(CurCodeDecl)->getParent()->isLambda()); - assert(cast<CXXMethodDecl>(CurCodeDecl)->getParent() == Field->getParent()); + if (CurCodeDecl) { + assert(cast<CXXMethodDecl>(CurCodeDecl)->getParent()->isLambda()); + assert(cast<CXXMethodDecl>(CurCodeDecl)->getParent() == Field->getParent()); + } QualType LambdaTagType = getContext().getTagDeclType(Field->getParent()); LValue LambdaLV = MakeNaturalAlignAddrLValue(CXXABIThisValue, LambdaTagType); Index: clang/lib/CodeGen/CGException.cpp =================================================================== --- clang/lib/CodeGen/CGException.cpp +++ clang/lib/CodeGen/CGException.cpp @@ -1966,7 +1966,6 @@ StartFunction(GlobalDecl(), RetTy, Fn, FnInfo, Args, OutlinedStmt->getBeginLoc(), OutlinedStmt->getBeginLoc()); CurSEHParent = ParentCGF.CurSEHParent; - CurCodeDecl = ParentCGF.CurCodeDecl; CGM.SetInternalFunctionAttributes(GlobalDecl(), CurFn, FnInfo); EmitCapturedLocals(ParentCGF, OutlinedStmt, IsFilter);
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits