Skip to content

[lldb][Expression] Printing union with self-referencing member field crashes lldb #68135

@Michael137

Description

@Michael137
//struct Attrs // << this works                 
union Attrs // << this crashes                  
{                                                                  
    static const Attrs regular;                 
};                                                                 
                                                                   
const Attrs Attrs::regular{};
                                                                   
int main() {                                                       
    Attrs d;                                    
    return 0;                                                      
}                                                                  
clang++ main.cpp -g -O0 -std=c++2a
./bin/lldb a.out -o "br se -p return -X main" -o run -o "frame var d"

(on llvm.org lldb build at commit 0bfaed8c612705cfa8c5382d26d8089a0a26386b)

This will infinitely recurse in ASTContext::getASTRecordLayout. Possibly the same crash as:

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions