Mercurial > projects > ldc
comparison gen/llvmhelpers.cpp @ 709:b972fb129d37
Add missing case to DtoAssign for T[n] = T[]. Fixes downs' initializer bug.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Thu, 16 Oct 2008 22:36:26 +0200 |
parents | 43165a082535 |
children | 30b42a283c8e |
comparison
equal
deleted
inserted
replaced
708:fd5665da3a27 | 709:b972fb129d37 |
---|---|
448 else { | 448 else { |
449 DtoArrayAssign(lhs->getLVal(), rhs->getRVal()); | 449 DtoArrayAssign(lhs->getLVal(), rhs->getRVal()); |
450 } | 450 } |
451 } | 451 } |
452 else if (t->ty == Tsarray) { | 452 else if (t->ty == Tsarray) { |
453 // T[n] = T[n] | |
453 if (DtoType(lhs->getType()) == DtoType(rhs->getType())) { | 454 if (DtoType(lhs->getType()) == DtoType(rhs->getType())) { |
454 DtoStaticArrayCopy(lhs->getLVal(), rhs->getRVal()); | 455 DtoStaticArrayCopy(lhs->getLVal(), rhs->getRVal()); |
455 } | 456 } |
456 else { | 457 // T[n] = T |
458 else if (t->next->toBasetype()->equals(t2)) { | |
457 DtoArrayInit(loc, lhs, rhs); | 459 DtoArrayInit(loc, lhs, rhs); |
460 } | |
461 // T[n] = T[] - generally only generated by frontend in rare cases | |
462 else if (t2->ty == Tarray && t->next->toBasetype()->equals(t2->next->toBasetype())) { | |
463 DtoMemCpy(lhs->getLVal(), DtoArrayPtr(rhs), DtoArrayLen(rhs)); | |
464 } else { | |
465 assert(0 && "Unimplemented static array assign!"); | |
458 } | 466 } |
459 } | 467 } |
460 else if (t->ty == Tdelegate) { | 468 else if (t->ty == Tdelegate) { |
461 if (rhs->isNull()) | 469 if (rhs->isNull()) |
462 DtoAggrZeroInit(lhs->getLVal()); | 470 DtoAggrZeroInit(lhs->getLVal()); |