]> git.mdlowis.com Git - proto/obnc.git/commitdiff
fixed record access
authorMichael D. Lowis <mike@mdlowis.com>
Wed, 5 Oct 2022 01:02:57 +0000 (21:02 -0400)
committerMichael D. Lowis <mike@mdlowis.com>
Wed, 5 Oct 2022 01:02:57 +0000 (21:02 -0400)
cerise/src/ssa.c
cerise/tests/Module.m

index 2e3ef55b4f39c90e8f6025c59a4ebf2feba05312..2dde0c0e6f14cb3506e4c873220adef72c05be44 100644 (file)
@@ -196,7 +196,7 @@ SsaNode* ssa_op(Parser* p, int op, SsaNode* left, SsaNode* right)
 
 SsaNode* ssa_store(Parser* p, SsaNode* dest, SsaNode* value)
 {
-    value = load(p, value);
+    value = loadmem(p, value);
     if (dest->mode == MODE_MEMORY && (dest->code == '[' || dest->code == '.'))
     {
         dest = load(p, dest);
index 3cd964f79f3932e313ab26016b05000379246e13..9dd680f3fac77269010eea6be7189f7c57dc3c93 100644 (file)
@@ -163,6 +163,7 @@ end
 procedure TestFlatArrayAccess()
 begin
     vIntArray[0] = vIntArray[1] + vIntArray[2];
+    vInt = vIntArray[1] + vIntArray[2];
 end
 
 procedure TestNestedArrayAccess()
@@ -173,12 +174,17 @@ end
 procedure TestRecordAccess()
 begin
     vRec2.a = vRec2.a + vRec2.a;
-#    vInt = vRec2.a;  # TODO: This is broken!
+    vInt = vRec2.a;
 end
 
 procedure TestNestedRecordAccess()
 begin
-    vRec1.b.c = vRec1.b.c + vRec1.b.c; # TODO: This is broken!
+    vRec1.b.c = vRec1.b.c + vRec1.b.c;
+end
+
+procedure TestFunctionCall()
+begin
+#    TestFunctionCall();
 end
 
 #begin