diff --git a/gen/arrays.cpp b/gen/arrays.cpp index da4196e3..6ad22c49 100644 --- a/gen/arrays.cpp +++ b/gen/arrays.cpp @@ -578,20 +578,18 @@ void DtoCatArrays(llvm::Value* arr, Expression* exp1, Expression* exp2) 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 --git a/ir/irsymbol.cpp b/ir/irsymbol.cpp index 4b8fcc15..c8d6394c 100644 --- a/ir/irsymbol.cpp +++ b/ir/irsymbol.cpp @@ -14,13 +14,13 @@ void IrDsymbol::resetAll() 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 --git a/ir/irtype.cpp b/ir/irtype.cpp index ffb7c414..12dcc998 100644 --- a/ir/irtype.cpp +++ b/ir/irtype.cpp @@ -13,13 +13,13 @@ void IrType::resetAll() 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; }