Mercurial > projects > ldc
changeset 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 | a92ec67eabe7 |
children | 94435b0ab2dd |
files | gen/arrays.cpp |
diffstat | 1 files changed, 6 insertions(+), 1 deletions(-) [+] |
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