Mercurial > projects > dang
changeset 113:244142a21cbc
Fix derefs as lvalues
author | Anders Halager <halager@gmail.com> |
---|---|
date | Sun, 25 May 2008 15:49:25 +0200 |
parents | d03b011c50e9 |
children | e89c42733e10 0cd8d6ab3f89 |
files | gen/CodeGen.d tests/sema/deref_3.d |
diffstat | 2 files changed, 13 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/gen/CodeGen.d Sun May 25 15:48:13 2008 +0200 +++ b/gen/CodeGen.d Sun May 25 15:49:25 2008 +0200 @@ -629,10 +629,10 @@ // LValue(*x): x // RValue(*x): load(x) // This way *x = *x + 1 will work - // TODO: Get's an i32** rather than i32* because it's alloc'd - // so there needs to be a load? + // We get an i32** rather than i32* because it's alloc'd + // so there needs to be a load auto DE = cast(DerefExp)exp; - return genLValue(DE.exp); + return LValue(genExpression(DE.exp).value); case ExpType.Index: auto indexExp = cast(IndexExp)exp; auto type = indexExp.target.type;