Add bitcast before loading value.

This commit is contained in:
kai 2015-03-21 19:42:58 +01:00
parent 398d25fd93
commit 05b501dc83

View file

@ -787,8 +787,7 @@ DSliceValue* DtoCatArrays(Loc& loc, Type* arrayType, Expression* exp1, Expressio
LLValue* array2 = DtoRawAlloca(type2, 0, ".array"); LLValue* array2 = DtoRawAlloca(type2, 0, ".array");
DtoStore(DtoConstSize_t(arrs.size()), DtoGEPi(array2, 0, 0, ".len")); DtoStore(DtoConstSize_t(arrs.size()), DtoGEPi(array2, 0, 0, ".len"));
DtoStore(DtoBitCast(array, ptrarraytype), DtoGEPi(array2, 0, 1, ".ptr")); DtoStore(DtoBitCast(array, ptrarraytype), DtoGEPi(array2, 0, 1, ".ptr"));
//LLValue* val = DtoLoad(array2); LLValue* val = DtoLoad(DtoBitCast(array2, getPtrToType(DtoArrayType(DtoArrayType(LLType::getInt8Ty(gIR->context()))))));
LLValue* val = DtoBitCast(DtoLoad(array2), DtoArrayType(DtoArrayType(LLType::getInt8Ty(gIR->context()))));
// TypeInfo ti // TypeInfo ti
args.push_back(DtoTypeInfoOf(arrayType)); args.push_back(DtoTypeInfoOf(arrayType));