diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2014-11-04 13:43:57 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2014-11-04 13:43:57 -0800 |
commit | 101ee552633752932bcd129add2f021f05ee680e (patch) | |
tree | 5bdd832e6a09e08982f5310200f6b39439d94d31 | |
parent | f27613a982b8a0d216802adfe22178c6670e40f5 (diff) | |
download | mu-101ee552633752932bcd129add2f021f05ee680e.tar.gz |
223
-rw-r--r-- | mu.arc | 5 | ||||
-rw-r--r-- | mu.arc.t | 9 |
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)) |