about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--mu.arc5
-rw-r--r--mu.arc.t9
2 files changed, 12 insertions, 2 deletions
diff --git a/mu.arc b/mu.arc
index be5b014c..69afae51 100644
--- a/mu.arc
+++ b/mu.arc
@@ -680,6 +680,7 @@
           (if (in op 'get 'get-address)
             (with (basetype  (typeinfo args.0)
                    field  (v args.1))
+              ; todo: need to rename args.0 as well?
               (when (pos 'deref (metadata args.0))
                 (assert basetype!address "@args.0 requests deref, but it's not an address of a record")
                 (= basetype (types* basetype!elem)))
@@ -694,11 +695,11 @@
               (assert (~isa-field v.arg) "arg @arg is also a field name")
               (when (maybe-add arg offset idx)
                 (err "use before set: @arg")
-                (++ idx))))
+                (++ idx (sizeof ty.arg)))))
           (each arg oargs
             (assert (~isa-field v.arg) "oarg @arg is also a field name")
             (when (maybe-add arg offset idx)
-              (++ idx))))))
+              (++ idx (sizeof ty.arg)))))))
     (each instr instrs
       (let (oargs op args)  (parse-instr instr)
         (each arg args
diff --git a/mu.arc.t b/mu.arc.t
index 4d77eb6b..f3035784 100644
--- a/mu.arc.t
+++ b/mu.arc.t
@@ -1276,6 +1276,15 @@
   (prn "F - convert-names renames symbolic names to integer locations"))
 
 (reset)
+;? (new-trace "convert-names-compound")
+(if (~iso (convert-names
+            '(((x integer-boolean-pair) <- copy (4 literal))
+              ((y integer) <- copy (2 literal))))
+          '(((1 integer-boolean-pair) <- copy (4 literal))
+            ((3 integer) <- copy (2 literal))))
+  (prn "F - convert-names increments integer locations by the size of the type of the previous var"))
+
+(reset)
 ;? (new-trace "convert-names-nil")
 (if (~iso (convert-names
             '(((x integer) <- copy (4 literal))