Call element postblit on "return array[0]".

Fixes DMD testcase 'sdtor'.
This commit is contained in:
David Nadlinger
2012-09-04 02:58:03 +02:00
parent 1cecab16cf
commit 45d9efb203

View File

@@ -1889,7 +1889,7 @@ void callPostblit(Loc &loc, Expression *exp, LLValue *val)
{
Type *tb = exp->type->toBasetype();
if ((exp->op == TOKvar || exp->op == TOKdotvar || exp->op == TOKstar || exp->op == TOKthis) &&
if ((exp->op == TOKvar || exp->op == TOKdotvar || exp->op == TOKstar || exp->op == TOKthis || exp->op == TOKindex) &&
tb->ty == Tstruct)
{ StructDeclaration *sd = static_cast<TypeStruct *>(tb)->sym;
if (sd->postblit)