Mercurial > projects > ldc
diff gen/arrays.cpp @ 293:ebfa488f4abc trunk
[svn r314] Get correct value type for newing of multidimensional dynamic arrays.
Fixes array_initialization_26_E.
author | ChristianK |
---|---|
date | Sun, 22 Jun 2008 15:21:34 +0200 |
parents | 068cb3c60afb |
children | 895e1b50cf2a |
line wrap: on
line diff
--- a/gen/arrays.cpp Sun Jun 22 13:23:28 2008 +0200 +++ b/gen/arrays.cpp Sun Jun 22 15:21:34 2008 +0200 @@ -486,8 +486,13 @@ // typeinfo arg LLValue* arrayTypeInfo = DtoTypeInfoOf(arrayType); + // get value type + Type* vtype = arrayType->toBasetype(); + for (size_t i=0; i<ndims; ++i) + vtype = vtype->nextOf(); + // 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