mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-04-19 10:19:03 +02:00
Do not memcpy with same source and destination.
This can happen for sret_args. Drop the assignment in this case.
This commit is contained in:
@@ -82,7 +82,8 @@ void ReturnStatement::toIR(IRState* p)
|
||||
DValue* rvar = new DVarValue(f->type->next, f->decl->ir.irFunc->retArg);
|
||||
DValue* e = exp->toElemDtor(p);
|
||||
// store return value
|
||||
DtoAssign(loc, rvar, e);
|
||||
if (rvar->getLVal() != e->getRVal())
|
||||
DtoAssign(loc, rvar, e);
|
||||
|
||||
// call postblit if necessary
|
||||
if (!p->func()->type->isref && !(f->decl->nrvo_can && f->decl->nrvo_var))
|
||||
|
||||
Reference in New Issue
Block a user