From 7a162b6f6d52892a9a580fa6013742a3b630e3c5 Mon Sep 17 00:00:00 2001 From: David Nadlinger Date: Fri, 31 Aug 2012 01:14:51 +0200 Subject: [PATCH] Fixed rvalue delegate property access. Covered by DMD testcase 'test42'. --- gen/toir.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/gen/toir.cpp b/gen/toir.cpp index 7df9c52f..6064b17d 100644 --- a/gen/toir.cpp +++ b/gen/toir.cpp @@ -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)))); }