From c53562ee10bda6ea91e260c7b77f3f117a7f924b Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Sun, 22 Jun 2008 15:21:34 +0200 Subject: [PATCH] [svn r314] Get correct value type for newing of multidimensional dynamic arrays. Fixes array_initialization_26_E. --- gen/arrays.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gen/arrays.cpp b/gen/arrays.cpp index c7cb4363..e0a1970f 100644 --- a/gen/arrays.cpp +++ b/gen/arrays.cpp @@ -486,8 +486,13 @@ DSliceValue* DtoNewMulDimDynArray(Type* arrayType, DValue** dims, size_t ndims, // typeinfo arg LLValue* arrayTypeInfo = DtoTypeInfoOf(arrayType); + // get value type + Type* vtype = arrayType->toBasetype(); + for (size_t i=0; inextOf(); + // get runtime function - bool zeroInit = arrayType->toBasetype()->nextOf()->isZeroInit(); + bool zeroInit = vtype->isZeroInit(); LLFunction* fn = LLVM_D_GetRuntimeFunction(gIR->module, zeroInit ? "_d_newarraymT" : "_d_newarraymiT" ); // build dims