mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-02-27 09:03:15 +01:00
[svn r316] Fixed array slice assignments like: int[] arr = ...; arr[] = 42;
There was problems with most non basic types... Added an option to premake so we can do: premake --target gnu --no-boehm to disable the Boehm GC.
This commit is contained in:
@@ -345,7 +345,7 @@ void DtoAssign(DValue* lhs, DValue* rhs)
|
||||
Type* t2 = DtoDType(rhs->getType());
|
||||
|
||||
if (t->ty == Tstruct) {
|
||||
if (t2 != t) {
|
||||
if (!t->equals(t2)) {
|
||||
// TODO: fix this, use 'rhs' for something
|
||||
DtoAggrZeroInit(lhs->getLVal());
|
||||
}
|
||||
@@ -359,11 +359,8 @@ void DtoAssign(DValue* lhs, DValue* rhs)
|
||||
if (DSliceValue* s2 = rhs->isSlice()) {
|
||||
DtoArrayCopySlices(s, s2);
|
||||
}
|
||||
else if (t->next == t2) {
|
||||
if (s->len)
|
||||
DtoArrayInit(s->ptr, s->len, rhs->getRVal());
|
||||
else
|
||||
DtoArrayInit(s->ptr, rhs->getRVal());
|
||||
else if (t->next->equals(t2)) {
|
||||
DtoArrayInit(s, rhs);
|
||||
}
|
||||
else {
|
||||
DtoArrayCopyToSlice(s, rhs);
|
||||
@@ -388,7 +385,7 @@ void DtoAssign(DValue* lhs, DValue* rhs)
|
||||
DtoStaticArrayCopy(lhs->getLVal(), rhs->getRVal());
|
||||
}
|
||||
else {
|
||||
DtoArrayInit(lhs->getLVal(), rhs->getRVal());
|
||||
DtoArrayInit(lhs, rhs);
|
||||
}
|
||||
}
|
||||
else if (t->ty == Tdelegate) {
|
||||
|
||||
Reference in New Issue
Block a user