Add slices in reverse order

This commit is contained in:
kai 2015-03-21 20:23:20 +01:00
parent 05b501dc83
commit bd0dc3b9d5

View file

@ -778,7 +778,7 @@ DSliceValue* DtoCatArrays(Loc& loc, Type* arrayType, Expression* exp1, Expressio
LLArrayType* type = LLArrayType::get(arraytype, arrs.size());
LLValue* array = DtoRawAlloca(type, 0, ".slicearray");
unsigned int i = 0;
for (std::vector<LLValue*>::iterator I = arrs.begin(), E = arrs.end(); I != E; ++I)
for (std::vector<LLValue*>::reverse_iterator I = arrs.rbegin(), E = arrs.rend(); I != E; ++I)
{
DtoStore(DtoLoad(*I), DtoGEPi(array, 0, i++, ".slice"));
}