diff options
-rw-r--r-- | mu.arc | 9 | ||||
-rw-r--r-- | mu.arc.t | 3 |
2 files changed, 8 insertions, 4 deletions
diff --git a/mu.arc b/mu.arc index 693bd73c..5ca46993 100644 --- a/mu.arc +++ b/mu.arc @@ -310,10 +310,11 @@ (or types*.typename!size (err "type @typename doesn't have a size: " (tostring:pr types*.typename)))) -(def addr (loc) - (ret result (v absolutize.loc) - (when (pos 'deref metadata.loc) - (zap memory* result)))) +(def addr (operand) + (let loc absolutize.operand + (while (pos 'deref metadata.loc) + (zap deref loc)) + v.loc)) (def addrs (n sz) (accum yield diff --git a/mu.arc.t b/mu.arc.t index 070d68bb..a7175d77 100644 --- a/mu.arc.t +++ b/mu.arc.t @@ -719,6 +719,9 @@ (= memory*.4 23) (if (~is 23 (addr '(4 integer-address deref))) (prn "F - 'addr' works with indirectly-addressed 'deref'")) +(= memory*.3 4) +(if (~is 23 (addr '(3 integer-address-address deref deref))) + (prn "F - 'addr' works with multiple 'deref'")) (= routine* make-routine!foo) (if (~is 4 (addr '(4 integer))) |