mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-11 18:33: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:
@@ -31,7 +31,6 @@ IrGlobal::IrGlobal(VarDeclaration* v): IrVar(v)
|
||||
IrLocal::IrLocal(VarDeclaration* v) : IrVar(v)
|
||||
{
|
||||
nestedIndex = -1;
|
||||
byref = false;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -28,8 +28,8 @@ struct IrLocal : IrVar
|
||||
{
|
||||
IrLocal(VarDeclaration* v);
|
||||
|
||||
bool byref; // Not used for -nested-ctx=array
|
||||
int nestedDepth; // ditto
|
||||
// Used for hybrid nested context creation.
|
||||
int nestedDepth;
|
||||
int nestedIndex;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user