[LLVMbugs] [Bug 5883] New: NULL pointer dereference in sema

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Fri Dec 25 12:54:36 PST 2009


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

           Summary: NULL pointer dereference in sema
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Semantic Analyzer
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: asl at math.spbu.ru
                CC: llvmbugs at cs.uiuc.edu
            Blocks: 5881


Created an attachment (id=3980)
 --> (http://llvm.org/bugs/attachment.cgi?id=3980)
Preprocessed source

Consider the attached preprocessed source. clang++ just crashes on it. valgrind
reports the following:

==20539== Invalid read of size 1
==20539==    at 0x8A2540: clang::DeclContext::isTransparentContext() const
(DeclBase.cpp:478)
==20539==    by 0x7DDD43: clang::Sema::CppLookupName(clang::LookupResult&,
clang::Scope*) (SemaLookup.cpp:579)
==20539==    by 0x7DE22F: clang::Sema::LookupName(clang::LookupResult&,
clang::Scope*, bool) (SemaLookup.cpp:715)
==20539==    by 0x7DE5BF: clang::Sema::LookupSingleName(clang::Scope*,
clang::DeclarationName, clang::Sema::LookupNameKind,
clang::Sema::RedeclarationKind) (SemaLookup.cpp:1591)
==20539==    by 0x73F48F: clang::Sema::ActOnParamDeclarator(clang::Scope*,
clang::Declarator&) (SemaDecl.cpp:3966)
==20539==    by 0x938F15:
clang::Parser::ParseFunctionDeclarator(clang::SourceLocation,
clang::Declarator&, clang::AttributeList*, bool) (ParseDecl.cpp:2706)
==20539==    by 0x939F83:
clang::Parser::ParseDirectDeclarator(clang::Declarator&) (ParseDecl.cpp:2439)
==20539==    by 0x935025:
clang::Parser::ParseDeclaratorInternal(clang::Declarator&, void
(clang::Parser::*)(clang::Declarator&)) (ParseDecl.cpp:2204)
==20539==    by 0x935671: clang::Parser::ParseDeclarator(clang::Declarator&)
(ParseDecl.cpp:2164)
==20539==    by 0x9589C4:
clang::Parser::ParseSingleDeclarationAfterTemplate(unsigned int,
clang::Parser::ParsedTemplateInfo const&, clang::SourceLocation&,
clang::AccessSpecifier) (ParseTemplate.cpp:210)
==20539==    by 0x95912A:
clang::Parser::ParseTemplateDeclarationOrSpecialization(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier) (ParseTemplate.cpp:155)
==20539==    by 0x959209:
clang::Parser::ParseDeclarationStartingWithTemplate(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier) (ParseTemplate.cpp:32)
==20539==  Address 0x0 is not stack'd, malloc'd or (recently) free'd


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