Mercurial > projects > ldc
diff gen/arrays.cpp @ 211:f66219e0d530 trunk
[svn r227] Fixed: crash in lifetime.d when resizing array of AAs by .length assignment.
author | lindquist |
---|---|
date | Tue, 27 May 2008 19:53:29 +0200 |
parents | 9d44ec83acd1 |
children | 7816aafeea3c |
line wrap: on
line diff
--- a/gen/arrays.cpp Wed May 14 02:00:23 2008 +0200 +++ b/gen/arrays.cpp Tue May 27 19:53:29 2008 +0200 @@ -545,7 +545,10 @@ assert(arrayType); assert(arrayType->toBasetype()->ty == Tarray); - bool zeroInit = arrayType->toBasetype()->nextOf()->isZeroInit(); + // decide on what runtime function to call based on whether the type is zero initialized + bool zeroInit = arrayType->toBasetype()->next->isZeroInit(); + + // call runtime llvm::Function* fn = LLVM_D_GetRuntimeFunction(gIR->module, zeroInit ? "_d_arraysetlengthT" : "_d_arraysetlengthiT" ); llvm::SmallVector<llvm::Value*,4> args;