mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-02-26 08:33:14 +01:00
Correctly handle ref variables in an outer frame.
Fixes DMD testcase 'testcontracts'.
This commit is contained in:
@@ -597,12 +597,10 @@ DValue* AssignExp::toElem(IRState* p)
|
||||
// Note that the variable value is accessed directly (instead
|
||||
// of via getLValue(), which would perform a load from the
|
||||
// uninitialized location), and that rhs is stored as an l-value!
|
||||
|
||||
IrLocal* const local = ve->var->ir.irLocal;
|
||||
assert(local && "ref var must be local and already initialized");
|
||||
|
||||
DVarValue* lhs = e1->toElem(p)->isVar();
|
||||
assert(lhs);
|
||||
DValue* rhs = e2->toElem(p);
|
||||
DtoStore(rhs->getLVal(), local->value);
|
||||
DtoStore(rhs->getLVal(), lhs->getRefStorage());
|
||||
return rhs;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user