# HG changeset patch # User lindquist # Date 1210091806 -7200 # Node ID 16e676ae5ab42510d173e6f3becb2c769a141db0 # Parent db9890b3fb64142ac13f6024b43ba5ac008af9d5 [svn r190] Fixed array concatenation for some broken cases. Added a sanity check for the Dsymbol state set. diff -r db9890b3fb64 -r 16e676ae5ab4 gen/arrays.cpp --- a/gen/arrays.cpp Tue May 06 07:56:03 2008 +0200 +++ b/gen/arrays.cpp Tue May 06 18:36:46 2008 +0200 @@ -578,20 +578,18 @@ assert(t1->ty == t2->ty); DValue* e1 = exp1->toElem(gIR); - llvm::Value* a = e1->getRVal(); - DValue* e2 = exp2->toElem(gIR); - llvm::Value* b = e2->getRVal(); llvm::Value *len1, *len2, *src1, *src2, *res; - len1 = gIR->ir->CreateLoad(DtoGEPi(a,0,0,"tmp"),"tmp"); - len2 = gIR->ir->CreateLoad(DtoGEPi(b,0,0,"tmp"),"tmp"); + + len1 = DtoArrayLen(e1); + len2 = DtoArrayLen(e2); res = gIR->ir->CreateAdd(len1,len2,"tmp"); llvm::Value* mem = DtoNewDynArray(arr, res, DtoDType(t1->next), false); - src1 = gIR->ir->CreateLoad(DtoGEPi(a,0,1,"tmp"),"tmp"); - src2 = gIR->ir->CreateLoad(DtoGEPi(b,0,1,"tmp"),"tmp"); + src1 = DtoArrayPtr(e1); + src2 = DtoArrayPtr(e2); DtoMemCpy(mem,src1,len1); mem = gIR->ir->CreateGEP(mem,len1,"tmp"); diff -r db9890b3fb64 -r 16e676ae5ab4 ir/irsymbol.cpp --- a/ir/irsymbol.cpp Tue May 06 07:56:03 2008 +0200 +++ b/ir/irsymbol.cpp Tue May 06 18:36:46 2008 +0200 @@ -14,13 +14,13 @@ IrDsymbol::IrDsymbol() { - list.insert(this); + assert(list.insert(this).second); reset(); } IrDsymbol::IrDsymbol(const IrDsymbol& s) { - list.insert(this); + assert(list.insert(this).second); DModule = s.DModule; irModule = s.irModule; irStruct = s.irStruct; diff -r db9890b3fb64 -r 16e676ae5ab4 ir/irtype.cpp --- a/ir/irtype.cpp Tue May 06 07:56:03 2008 +0200 +++ b/ir/irtype.cpp Tue May 06 18:36:46 2008 +0200 @@ -13,13 +13,13 @@ IrType::IrType() { - list.insert(this); + assert(list.insert(this).second); reset(); } IrType::IrType(const IrType& s) { - list.insert(this); + assert(list.insert(this).second); type = s.type; vtblType = s.type; }