-
Notifications
You must be signed in to change notification settings - Fork 12.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Windows] evaluating a variable from an outer scope in a @finally inside a block causes an internal compiler error #43828
Comments
Additional information from a TRUNK build. Assertion failed: Val && "isa<> used on a null pointer", file E:\src\llvm\include\llvm/Support/Casting.h, line 105 0x00007FF7C1F41FA8 (0x0000000519382838 0x000001A277CBC860 0x000001A277C59918 0xCCCCCCCCCCCCCCCC), llvm::isa<clang::ImplicitParamDecl,clang::VarDecl const *>() + 0x28 bytes(s), E:\src\llvm\include\llvm\Support\Casting.h, line 144 |
David, it looks like we're trying to capture "CXXAbiThisDecl" somewhere south of CGObjCRuntime::EmitTryCatchStmt() for a funclet finally in SEH mode. EmitTryCatchStmt -> startOutlinedSEHHelper -> EmitCapturedLocals -> CaptureFinder(CXXABIThisDecl) -> CaptureFinder::VisitDeclRefExpr -> refersToEnclosingVariableOrCapture therefore insert ParentThis. Problem is, CXXAbiThisDecl is null because there is no this decl and we're not in a C++ context with a |
I applied a shallow fix, but things just crash later: diff --git a/clang/lib/CodeGen/CGException.cpp b/clang/lib/CodeGen/CGException.cpp void VisitDeclRefExpr(const DeclRefExpr *E) {
I seem to recall assuming somewhere that SEH only happens in FunctionDecls, but BlockDecl doesn't inherit from FunctionDecl. |
See also #51899 for an even simpler reproduction without referencing a variable. Basically using |
Known issues: #7 llvm/llvm-project#43828 llvm/llvm-project#51899 llvm/llvm-project#54556 llvm/llvm-project#56952 gnustep/libobjc2#222 Also removed copy about GNUstep test failures, as they have been fixed.
@llvm/issue-subscribers-clang-frontend |
Extended Description
With the following source:
the compiler fails with the following stack dump.
The text was updated successfully, but these errors were encountered: