[LLVMbugs] [Bug 7291] New: crash on initializer containing an assignment

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Jun 3 05:20:00 PDT 2010


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

           Summary: crash on initializer containing an assignment
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: benny.kra at gmail.com
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


reduced from mysql-5.0.90

$ cat t.cc
struct Foo {
  unsigned file_id;

  Foo(unsigned arg);
};

Foo::Foo(unsigned arg) : file_id(arg = 42)
{ }

$ clang t.cc
Stack dump:
0.    Program arguments: /Users/d0k/Desktop/build/llvm/Debug/bin/clang -cc1
-triple x86_64-apple-darwin10.0.0 -emit-obj -mrelax-all -disable-free
-main-file-name t.cc -pic-level 1 -mdisable-fp-elim -masm-verbose
-munwind-tables -target-cpu core2 -resource-dir
/Users/d0k/Desktop/build/llvm/Debug/lib/clang/2.0 -ferror-limit 19
-fmessage-length 110 -stack-protector 1 -fblocks -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -o
/var/folders/OV/OVTXSzUoG4ui5ZOmbcD2uE+++TI/-Tmp-/cc-Rxt6vI.o -x c++ t.cc 
1.    <eof> parser at end of file
2.    t.cc:7:6: LLVM IR generation of declaration 'Foo::Foo'
3.    t.cc:7:6: Generating code for declaration 'Foo::Foo'
clang: error: clang frontend command failed due to signal 11 (use -v to see
invocation)

$ clang --version
clang version 2.0 (trunk 105388)

stack trace:
#0  0x0000000101b079c8 in llvm::PATypeHolder::get (this=0x10) at Type.h:507
#1  0x0000000101c0117b in llvm::PATypeHolder::operator-> (this=0x10) at
AbstractTypeUser.h:162
#2  0x0000000101f1cc61 in llvm::Value::getContext (this=0x0) at Value.cpp:377
#3  0x0000000101ed58a2 in llvm::StoreInst::StoreInst (this=0x10461c920,
val=0x0, addr=0x10461c798, isVolatile=false, InsertBefore=0x0) at
Instructions.cpp:1079
#4  0x00000001001bb5f7 in llvm::IRBuilder<true, llvm::ConstantFolder,
llvm::IRBuilderDefaultInserter<true> >::CreateStore (this=0x7fff5fbfc590,
Val=0x0, Ptr=0x10461c798, isVolatile=false) at IRBuilder.h:610
#5  0x00000001001700b8 in clang::CodeGen::CodeGenFunction::EmitStoreOfScalar
(this=0x7fff5fbfc4c0, Value=0x0, Addr=0x10461c798, Volatile=false, Ty={Value =
{Value = 4368446768}}) at CGExpr.cpp:671
#6  0x00000001001721d3 in
clang::CodeGen::CodeGenFunction::EmitStoreThroughLValue (this=0x7fff5fbfc4c0,
Src={V1 = {Value = 0}, V2 = {Value = 0}}, Dst={LVType =
clang::CodeGen::LValue::Simple, V = 0x10461c798, {VectorIdx = 0x7fff5fbfbe70,
VectorElts = 0x7fff5fbfbe70, BitFieldInfo = 0x7fff5fbfbe70, PropertyRefExpr =
0x7fff5fbfbe70, KVCRefExpr = 0x7fff5fbfbe70}, Quals = {Mask = 0, static
GCAttrMask = 24, static GCAttrShift = 3, static AddressSpaceMask = 4294967264,
static AddressSpaceShift = 5}, Ivar = false, ObjIsArray = false, NonGC = false,
GlobalObjCRef = false, BaseIvarExp = 0x0}, Ty={Value = {Value = 4368446768}})
at CGExpr.cpp:906
#7  0x0000000100151a3c in EmitMemberInitializer (CGF=@0x7fff5fbfc4c0,
ClassDecl=0x10461a110, MemberInit=0x10461ac40, Constructor=0x10461aa10,
Args=@0x7fff5fbfc260) at CGClass.cpp:471
#8  0x0000000100154610 in clang::CodeGen::CodeGenFunction::EmitCtorPrologue
(this=0x7fff5fbfc4c0, CD=0x10461aa10, CtorType=clang::Ctor_Base,
Args=@0x7fff5fbfc260) at CGClass.cpp:667
#9  0x0000000100154754 in clang::CodeGen::CodeGenFunction::EmitConstructorBody
(this=0x7fff5fbfc4c0, Args=@0x7fff5fbfc260) at CGClass.cpp:620
#10 0x000000010020bbdf in clang::CodeGen::CodeGenFunction::GenerateCode
(this=0x7fff5fbfc4c0, GD={Value = {Value = 4368476689}}, Fn=0x10461bce0) at
CodeGenFunction.cpp:306
#11 0x000000010014895b in clang::CodeGen::CodeGenModule::EmitCXXConstructor
(this=0x10483c400, D=0x10461aa10, Type=clang::Ctor_Base) at CGCXX.cpp:212
#12 0x0000000100216912 in clang::CodeGen::CodeGenModule::EmitGlobalDefinition
(this=0x10483c400, GD={Value = {Value = 4368476689}}) at CodeGenModule.cpp:743
#13 0x0000000100216ae9 in clang::CodeGen::CodeGenModule::EmitGlobal
(this=0x10483c400, GD={Value = {Value = 4368476689}}) at CodeGenModule.cpp:713
#14 0x00000001001481f4 in clang::CodeGen::CodeGenModule::EmitCXXConstructors
(this=0x10483c400, D=0x10461aa10) at CGCXX.cpp:196
#15 0x0000000100216e45 in clang::CodeGen::CodeGenModule::EmitTopLevelDecl
(this=0x10483c400, D=0x10461aa10) at CodeGenModule.cpp:1937
#16 0x000000010023476a in (anonymous
namespace)::CodeGeneratorImpl::HandleTopLevelDecl (this=0x1046172b0, DG={D =
0x10461aa10}) at ModuleBuilder.cpp:65
#17 0x00000001000270f6 in (anonymous
namespace)::BackendConsumer::HandleTopLevelDecl (this=0x1046176d0, D={D =
0x10461aa10}) at CodeGenAction.cpp:147

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