changeset 115:e89c42733e10

Ehh... not sure why...
author Anders Johnsen <skabet@gmail.com>
date Sun, 25 May 2008 16:41:19 +0200
parents 3a0cd42de9cc (current diff) 244142a21cbc (diff)
children 54955003765b
files gen/CodeGen.d
diffstat 2 files changed, 13 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/gen/CodeGen.d	Sun May 25 16:40:38 2008 +0200
+++ b/gen/CodeGen.d	Sun May 25 16:41:19 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;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/sema/deref_3.d	Sun May 25 16:41:19 2008 +0200
@@ -0,0 +1,10 @@
+int main()
+{
+    int *a;
+    int **b;
+    *a = 1;
+    *b = a;
+
+    return *a == **b;
+}
+