Fixed rvalue delegate property access.

Covered by DMD testcase 'test42'.
This commit is contained in:
David Nadlinger
2012-08-31 01:14:51 +02:00
parent 364cfb6714
commit 7a162b6f6d

View File

@@ -3116,10 +3116,9 @@ LruntimeInit:
DValue* GEPExp::toElem(IRState* p)
{
// this should be good enough for now!
DValue* val = e1->toElem(p);
assert(val->isLVal());
LLValue* v = DtoGEPi(val->getLVal(), 0, index);
// (&a.foo).funcptr is a case where e1->toElem is genuinely not an l-value.
LLValue* val = makeLValue(loc, e1->toElem(p));
LLValue* v = DtoGEPi(val, 0, index);
return new DVarValue(type, DtoBitCast(v, getPtrToType(DtoType(type))));
}