Mercurial > projects > ldc
comparison 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 |
comparison
equal
deleted
inserted
replaced
210:1d6cfdbc97f0 | 211:f66219e0d530 |
---|---|
543 assert(array); | 543 assert(array); |
544 assert(newdim); | 544 assert(newdim); |
545 assert(arrayType); | 545 assert(arrayType); |
546 assert(arrayType->toBasetype()->ty == Tarray); | 546 assert(arrayType->toBasetype()->ty == Tarray); |
547 | 547 |
548 bool zeroInit = arrayType->toBasetype()->nextOf()->isZeroInit(); | 548 // decide on what runtime function to call based on whether the type is zero initialized |
549 bool zeroInit = arrayType->toBasetype()->next->isZeroInit(); | |
550 | |
551 // call runtime | |
549 llvm::Function* fn = LLVM_D_GetRuntimeFunction(gIR->module, zeroInit ? "_d_arraysetlengthT" : "_d_arraysetlengthiT" ); | 552 llvm::Function* fn = LLVM_D_GetRuntimeFunction(gIR->module, zeroInit ? "_d_arraysetlengthT" : "_d_arraysetlengthiT" ); |
550 | 553 |
551 llvm::SmallVector<llvm::Value*,4> args; | 554 llvm::SmallVector<llvm::Value*,4> args; |
552 args.push_back(DtoTypeInfoOf(arrayType)); | 555 args.push_back(DtoTypeInfoOf(arrayType)); |
553 args.push_back(newdim->getRVal()); | 556 args.push_back(newdim->getRVal()); |