D2: pass static arrays into functions by value

This commit is contained in:
Alexey Prokhin
2011-04-30 15:30:57 +04:00
parent 069f0a6262
commit 805fb5cfc1
5 changed files with 22 additions and 27 deletions

View File

@@ -144,7 +144,7 @@ void ReturnStatement::toIR(IRState* p)
// If the function returns a struct or a static array, and the return
// value is a pointer to a struct or a static array, load from it
// before returning.
int ty = f->type->next->ty;
int ty = f->type->next->toBasetype()->ty;
if (v->getType() != p->topfunc()->getReturnType() &&
(ty == Tstruct
#if DMDV2