[LLVMbugs] [Bug 2161] New: code fragment from gcc 4. 2 sources crashes clang -fsyntax-only

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Mon Mar 17 09:51:06 PDT 2008


http://llvm.org/bugs/show_bug.cgi?id=2161

           Summary: code fragment from gcc 4.2 sources crashes clang -
                    fsyntax-only
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Semantic Analyzer
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: kremenek at cs.stanford.edu
                CC: llvmbugs at cs.uiuc.edu


Created an attachment (id=1548)
 --> (http://llvm.org/bugs/attachment.cgi?id=1548)
Test cases that crashes clang -fsyntax-only

The following code fragment crashes clang -fsyntax-only (also attached):

     void decimal_real_maxval (struct real_value *r, int sign, enum
machine_mode mode) {
               switch (mode)     { 

I see the following in gdb:

(gdb) r
Starting program: /Volumes/MyBookScratch/Debug_clang_2/clang -fsyntax-only
t.c.ok
Reading symbols for shared libraries +++. done
t.c.ok:3:2: error: expected '}'

 ^

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000004
0x00118801 in clang::Type::getCanonicalTypeInternal (this=0x0) at Type.h:360
360       QualType getCanonicalTypeInternal() const { return CanonicalType; }
(gdb) bt
#0  0x00118801 in clang::Type::getCanonicalTypeInternal (this=0x0) at
Type.h:360
#1  0x0011883e in clang::QualType::getCanonicalType (this=0xbfffe108) at
Type.h:1102
#2  0x000e7a01 in clang::ASTContext::getTypeInfo (this=0xbfffee30, T={ThePtr =
0}) at ASTContext.cpp:184
#3  0x000e81f0 in clang::ASTContext::getTypeInfo (this=0xbfffee30, T={ThePtr =
9462992}) at ASTContext.cpp:302
#4  0x00057ad3 in clang::ASTContext::getTypeSize (this=0xbfffee30, T={ThePtr =
9462992}) at ASTContext.h:272
#5  0x000d9066 in clang::Sema::ActOnFinishSwitchStmt (this=0x902620,
SwitchLoc={ID = 131182}, Switch=0x9066d0, Body=0x901410) at SemaStmt.cpp:310
#6  0x00141ba6 in clang::Parser::ParseSwitchStatement (this=0xbfffefe0) at
ParseStmt.cpp:622
#7  0x001407f1 in clang::Parser::ParseStatementOrDeclaration (this=0xbfffefe0,
OnlyStatement=false) at ParseStmt.cpp:131
#8  0x0013fdb4 in clang::Parser::ParseCompoundStatementBody (this=0xbfffefe0,
isStmtExpr=false) at ParseStmt.cpp:425
#9  0x0014019e in clang::Parser::ParseFunctionStatementBody (this=0xbfffefe0,
Decl=0x906510, L={ID = 131159}, R={ID = 131159}) at ParseStmt.cpp:1149
#10 0x00144166 in clang::Parser::ParseFunctionDefinition (this=0xbfffefe0,
D=@0xbfffec20) at Parser.cpp:490
#11 0x001446a9 in clang::Parser::ParseDeclarationOrFunctionDefinition
(this=0xbfffefe0) at Parser.cpp:436
#12 0x00144803 in clang::Parser::ParseExternalDeclaration (this=0xbfffefe0) at
Parser.cpp:350
#13 0x00144a21 in clang::Parser::ParseTopLevelDecl (this=0xbfffefe0,
Result=@0xbffff08c) at Parser.cpp:267
#14 0x000b39ab in clang::ParseAST (PP=@0xbffff184, Consumer=0x901220,
PrintStats=false) at ParseAST.cpp:48
#15 0x00024148 in ProcessInputFile (PP=@0xbffff184, InFile=@0x901450,
OurDiagnosticClient=@0x901470) at clang.cpp:1111
#16 0x00026858 in main (argc=3, argv=0xbffff488) at clang.cpp:1305
(gdb)


-- 
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