mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-02-09 00:13:14 +01:00
Properly handle DMD-internal "reference variables".
Previously, we just had a hack to make ref foreach statements work. This commit enables them to work in other cases as well, like the implicit __result variable for functions with out-contracts (which is such a magic ref variable for ref-returning functions). Fixes DMD testcase 'testcontracts'.
This commit is contained in:
@@ -815,8 +815,7 @@ void DtoDefineFunction(FuncDeclaration* fd)
|
||||
{
|
||||
DtoNestedInit(fd->vresult);
|
||||
} else if (fd->vresult) {
|
||||
fd->vresult->ir.irLocal = new IrLocal(fd->vresult);
|
||||
fd->vresult->ir.irLocal->value = DtoAlloca(fd->vresult->type, fd->vresult->toChars());
|
||||
DtoVarDeclaration(fd->vresult);
|
||||
}
|
||||
|
||||
// copy _argptr and _arguments to a memory location
|
||||
|
||||
Reference in New Issue
Block a user