[LLVMbugs] [Bug 19944] New: bad write in InitListExpr::resizeInits

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Jun 4 08:28:25 PDT 2014


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

            Bug ID: 19944
           Summary: bad write in InitListExpr::resizeInits
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: dcb314 at hotmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 12605
  --> http://llvm.org/bugs/attachment.cgi?id=12605&action=edit
C source code

I just compiled the attached code with llvm trunk
dated 20140604 and valgrind said

==21409== Invalid write of size 8
==21409==    at 0x13D839D: clang::InitListExpr::resizeInits(clang::ASTContext
const&, unsigned int) (ASTVector.h:356)
==21409==    by 0xCF8EB8: (anonymous
namespace)::InitListChecker::CheckDesignatedInitializer(clang::InitializedEntity
const&, clang::InitLis
tExpr*, clang::DesignatedInitExpr*, unsigned int, clang::QualType&,
clang::DeclContext::specific_decl_iterator<clang::FieldDecl>*, llvm::APS
Int*, unsigned int&, clang::InitListExpr*, unsigned int&, bool, bool)
(SemaInit.cpp:2189)
==21409==    by 0xCFA741: (anonymous
namespace)::InitListChecker::CheckArrayType(clang::InitializedEntity const&,
clang::InitListExpr*, clan
g::QualType&, llvm::APSInt, bool, unsigned int&, clang::InitListExpr*, unsigned
int&) (SemaInit.cpp:1317)
==21409==    by 0xCF59C1: (anonymous
namespace)::InitListChecker::CheckListElementTypes(clang::InitializedEntity
const&, clang::InitListExpr
*, clang::QualType&, bool, unsigned int&, clang::InitListExpr*, unsigned int&,
bool) [clone .constprop.726] (SemaInit.cpp:815)
==21409==    by 0xCF64E4: (anonymous
namespace)::InitListChecker::CheckExplicitInitList(clang::InitializedEntity
const&, clang::InitListExpr
*, clang::QualType&, clang::InitListExpr*, bool) (SemaInit.cpp:715)
==21409==    by 0xCF1774: (anonymous
namespace)::InitListChecker::InitListChecker(clang::Sema&,
clang::InitializedEntity const&, clang::Init
ListExpr*, clang::QualType&, bool) (SemaInit.cpp:593)
==21409==    by 0xCEF48B: clang::InitializationSequence::Perform(clang::Sema&,
clang::InitializedEntity const&, clang::InitializationKind co
nst&, llvm::MutableArrayRef<clang::Expr*>, clang::QualType*)
(SemaInit.cpp:5996)
==21409==    by 0xBA692B: clang::Sema::AddInitializerToDecl(clang::Decl*,
clang::Expr*, bool, bool) (SemaDecl.cpp:8366)
==21409==    by 0xA6BD76:
clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&,
clang::Parser::ParsedTemplateInfo 
const&, clang::Parser::ForRangeInit*) (ParseDecl.cpp:1861)
==21409==    by 0xA787B5:
clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, unsigned int, bool,
clang::SourceLocation*, clang::Parser::
ForRangeInit*) (ParseDecl.cpp:1626)
==21409==    by 0xA5D018:
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, 
clang::AccessSpecifier) (Parser.cpp:888)
==21409==    by 0xA5D6A0:
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclS
pec*, clang::AccessSpecifier) [clone .part.217] (Parser.cpp:904)
==21409==  Address 0x8 is not stack'd, malloc'd or (recently) free'd
==21409==

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140604/f361e9d0/attachment.html>


More information about the llvm-bugs mailing list