mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-11-26 19:03:50 +01:00
Workaround for Voldemort return type handling issues.
See the comment in DtoCallFunction for an explanation of what is going on. The struct zero initialization code was also refactored out to AssignExp::toElem and modified so that it is only triggered on integer->struct assignments, not for any types where the modifier-stripped types don't match up. This would have lead to silently wrong code in the cases where the assert would have been triggered otherwise. Fixes the Phobos testsuite build.
This commit is contained in:
+1
-13
@@ -393,19 +393,7 @@ void DtoAssign(Loc& loc, DValue* lhs, DValue* rhs, int op)
|
||||
Type* t2 = rhs->getType()->toBasetype();
|
||||
|
||||
if (t->ty == Tstruct) {
|
||||
if (!stripModifiers(t)->equals(stripModifiers(t2))) {
|
||||
// FIXME: use 'rhs' for something !?!
|
||||
DtoAggrZeroInit(lhs->getLVal());
|
||||
#if DMDV2
|
||||
TypeStruct *ts = static_cast<TypeStruct*>(lhs->getType());
|
||||
if (ts->sym->isNested() && ts->sym->vthis)
|
||||
DtoResolveNestedContext(loc, ts->sym, lhs->getLVal());
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
DtoAggrCopy(lhs->getLVal(), rhs->getRVal());
|
||||
}
|
||||
|
||||
DtoAggrCopy(lhs->getLVal(), rhs->getRVal());
|
||||
}
|
||||
else if (t->ty == Tarray) {
|
||||
// lhs is slice
|
||||
|
||||
Reference in New Issue
Block a user