mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-02-07 07:23:13 +01:00
Add missing case to DtoAssign for T[n] = T[]. Fixes downs' initializer bug.
This commit is contained in:
@@ -450,12 +450,20 @@ void DtoAssign(Loc& loc, DValue* lhs, DValue* rhs)
|
||||
}
|
||||
}
|
||||
else if (t->ty == Tsarray) {
|
||||
// T[n] = T[n]
|
||||
if (DtoType(lhs->getType()) == DtoType(rhs->getType())) {
|
||||
DtoStaticArrayCopy(lhs->getLVal(), rhs->getRVal());
|
||||
}
|
||||
else {
|
||||
// T[n] = T
|
||||
else if (t->next->toBasetype()->equals(t2)) {
|
||||
DtoArrayInit(loc, lhs, rhs);
|
||||
}
|
||||
// T[n] = T[] - generally only generated by frontend in rare cases
|
||||
else if (t2->ty == Tarray && t->next->toBasetype()->equals(t2->next->toBasetype())) {
|
||||
DtoMemCpy(lhs->getLVal(), DtoArrayPtr(rhs), DtoArrayLen(rhs));
|
||||
} else {
|
||||
assert(0 && "Unimplemented static array assign!");
|
||||
}
|
||||
}
|
||||
else if (t->ty == Tdelegate) {
|
||||
if (rhs->isNull())
|
||||
|
||||
Reference in New Issue
Block a user