[LLVMbugs] [Bug 4017] New: crash in bitfield diagnostic
bugzilla-daemon at cs.uiuc.edu
bugzilla-daemon at cs.uiuc.edu
Sun Apr 19 23:08:02 PDT 2009
http://llvm.org/bugs/show_bug.cgi?id=4017
Summary: crash in bitfield diagnostic
Product: clang
Version: unspecified
Platform: PC
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: Semantic Analyzer
AssignedTo: unassignedclangbugs at nondot.org
ReportedBy: daniel at zuster.org
CC: llvmbugs at cs.uiuc.edu
clang crashes in diagnostic printing for:
--
struct s0 { char : 10; };
--
and
--
struct s0 { unsigned : -2; };
--
--
ddunbar at ozzy:tmp$ echo "struct s0 { char : 10 };" | clang-cc
<stdin>:1:13: error: 0 clang-cc 0x0000000100b09310
PrintStackTrace(void*) + 38
1 clang-cc 0x0000000100b09820 SignalHandler(int) + 288
2 libSystem.B.dylib 0x00007fff80aa58ba _sigtramp + 26
3 libSystem.B.dylib 0x00007fff5fbfa4e0 _sigtramp + 3742714944
4 clang-cc 0x00000001003bf90d
clang::DiagnosticInfo::FormatDiagnostic(llvm::SmallVectorImpl<char>&) const +
1485
5 clang-cc 0x00000001002b8d3c
clang::TextDiagnosticPrinter::HandleDiagnostic(clang::Diagnostic::Level,
clang::DiagnosticInfo const&) + 1430
6 clang-cc 0x00000001003bfba8 clang::Diagnostic::ProcessDiag() + 474
7 clang-cc 0x000000010036d12c clang::DiagnosticBuilder::Emit() + 96
8 clang-cc 0x00000001001bbd3c
clang::Sema::SemaDiagnosticBuilder::~SemaDiagnosticBuilder() + 22
9 clang-cc 0x00000001001c7673
clang::Sema::VerifyBitField(clang::SourceLocation, clang::IdentifierInfo*,
clang::QualType, clang::Expr const*) + 1031
10 clang-cc 0x00000001001cafb4
clang::Sema::CheckFieldDecl(clang::DeclarationName, clang::QualType,
clang::RecordDecl*, clang::SourceLocation, bool, clang::Expr*,
clang::AccessSpecifier, clang::NamedDecl*, clang::Declarator*) + 458
11 clang-cc 0x00000001001d2504
clang::Sema::HandleField(clang::Scope*, clang::RecordDecl*,
clang::SourceLocation, clang::Declarator&, clang::Expr*,
clang::AccessSpecifier) + 620
12 clang-cc 0x00000001001d25e3 clang::Sema::ActOnField(clang::Scope*,
clang::OpaquePtr<0>, clang::SourceLocation, clang::Declarator&, void*) + 89
13 clang-cc 0x000000010035b0ed
clang::Parser::ParseStructUnionBody(clang::SourceLocation, unsigned int,
clang::OpaquePtr<0>) + 825
14 clang-cc 0x000000010036386a
clang::Parser::ParseClassSpecifier(clang::tok::TokenKind,
clang::SourceLocation, clang::DeclSpec&, llvm::SmallVector<void*, 4u>*,
clang::AccessSpecifier) + 2290
15 clang-cc 0x0000000100358e39
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
llvm::SmallVector<void*, 4u>*, clang::AccessSpecifier) + 4723
16 clang-cc 0x000000010038bd26
clang::Parser::ParseDeclarationOrFunctionDefinition(llvm::SmallVector<void*,
4u>*, clang::AccessSpecifier) + 92
17 clang-cc 0x000000010038c9e7
clang::Parser::ParseExternalDeclaration() + 1237
18 clang-cc 0x000000010038ca98
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<1>&) + 106
19 clang-cc 0x00000001001bb1c7 clang::ParseAST(clang::Preprocessor&,
clang::ASTConsumer*, clang::ASTContext&, bool, bool) + 365
20 clang-cc 0x00000001000744f3 ProcessInputFile(clang::Preprocessor&,
clang::PreprocessorFactory&, std::string const&, ProgActions) + 2558
21 clang-cc 0x00000001000778ed main + 2149
22 clang-cc 0x00000001000272ec start + 52
Stack dump:
0. Program arguments: clang-cc
1. <stdin>:1:23: current parser token '}'
2. <stdin>:1:1: parsing struct/union body 's0'
Segmentation fault
ddunbar at ozzy:tmp$ echo "struct s0 { char : -2 };" | clang-cc
<stdin>:1:13: error: 0 clang-cc 0x0000000100b09310
PrintStackTrace(void*) + 38
1 clang-cc 0x0000000100b09820 SignalHandler(int) + 288
2 libSystem.B.dylib 0x00007fff80aa58ba _sigtramp + 26
3 libSystem.B.dylib 0x00007fff5fbfa4e0 _sigtramp + 3742714944
4 clang-cc 0x00000001003bf90d
clang::DiagnosticInfo::FormatDiagnostic(llvm::SmallVectorImpl<char>&) const +
1485
5 clang-cc 0x00000001002b8d3c
clang::TextDiagnosticPrinter::HandleDiagnostic(clang::Diagnostic::Level,
clang::DiagnosticInfo const&) + 1430
6 clang-cc 0x00000001003bfba8 clang::Diagnostic::ProcessDiag() + 474
7 clang-cc 0x000000010036d12c clang::DiagnosticBuilder::Emit() + 96
8 clang-cc 0x00000001001bbd3c
clang::Sema::SemaDiagnosticBuilder::~SemaDiagnosticBuilder() + 22
9 clang-cc 0x00000001001c759c
clang::Sema::VerifyBitField(clang::SourceLocation, clang::IdentifierInfo*,
clang::QualType, clang::Expr const*) + 816
10 clang-cc 0x00000001001cafb4
clang::Sema::CheckFieldDecl(clang::DeclarationName, clang::QualType,
clang::RecordDecl*, clang::SourceLocation, bool, clang::Expr*,
clang::AccessSpecifier, clang::NamedDecl*, clang::Declarator*) + 458
11 clang-cc 0x00000001001d2504
clang::Sema::HandleField(clang::Scope*, clang::RecordDecl*,
clang::SourceLocation, clang::Declarator&, clang::Expr*,
clang::AccessSpecifier) + 620
12 clang-cc 0x00000001001d25e3 clang::Sema::ActOnField(clang::Scope*,
clang::OpaquePtr<0>, clang::SourceLocation, clang::Declarator&, void*) + 89
13 clang-cc 0x000000010035b0ed
clang::Parser::ParseStructUnionBody(clang::SourceLocation, unsigned int,
clang::OpaquePtr<0>) + 825
14 clang-cc 0x000000010036386a
clang::Parser::ParseClassSpecifier(clang::tok::TokenKind,
clang::SourceLocation, clang::DeclSpec&, llvm::SmallVector<void*, 4u>*,
clang::AccessSpecifier) + 2290
15 clang-cc 0x0000000100358e39
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
llvm::SmallVector<void*, 4u>*, clang::AccessSpecifier) + 4723
16 clang-cc 0x000000010038bd26
clang::Parser::ParseDeclarationOrFunctionDefinition(llvm::SmallVector<void*,
4u>*, clang::AccessSpecifier) + 92
17 clang-cc 0x000000010038c9e7
clang::Parser::ParseExternalDeclaration() + 1237
18 clang-cc 0x000000010038ca98
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<1>&) + 106
19 clang-cc 0x00000001001bb1c7 clang::ParseAST(clang::Preprocessor&,
clang::ASTConsumer*, clang::ASTContext&, bool, bool) + 365
20 clang-cc 0x00000001000744f3 ProcessInputFile(clang::Preprocessor&,
clang::PreprocessorFactory&, std::string const&, ProgActions) + 2558
21 clang-cc 0x00000001000778ed main + 2149
22 clang-cc 0x00000001000272ec start + 52
Stack dump:
0. Program arguments: clang-cc
1. <stdin>:1:23: current parser token '}'
2. <stdin>:1:1: parsing struct/union body 's0'
Segmentation fault
--
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the llvm-bugs
mailing list