about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2014-12-28 14:07:30 -0800
committerKartik K. Agaram <vc@akkartik.com>2014-12-28 14:07:30 -0800
commit32de6ad74a6e2f8370e34c1c64f3a9e111ad2fd4 (patch)
treea012b53663bd7369cf209f32820ec97d845be1b4
parent3513e03850d2eaa6a6f6f62dcac16a852364ea3b (diff)
downloadmu-32de6ad74a6e2f8370e34c1c64f3a9e111ad2fd4.tar.gz
454
-rw-r--r--mu.arc7
1 files changed, 5 insertions, 2 deletions
diff --git a/mu.arc b/mu.arc
index 08895bbe..07a9e5d4 100644
--- a/mu.arc
+++ b/mu.arc
@@ -311,6 +311,9 @@
 (def ty (operand)
   (cdr operand.0))
 
+(def literal? (operand)
+  (in ty.operand.0 'literal 'offset 'fn))
+
 (def typeinfo (operand)
   (or (type* ty.operand.0)
       (err "unknown type @(tostring prn.operand)")))
@@ -630,7 +633,7 @@
 
 (def m (loc)  ; read memory, respecting metadata
   (point return
-    (if (in ty.loc.0 'literal 'offset)
+    (when (literal? loc)
       (return v.loc))
     (when (is v.loc 'default-scope)
       (return rep.routine*!call-stack.0!default-scope))
@@ -971,7 +974,7 @@
 (def maybe-add (arg location idx)
   (trace "maybe-add" arg)
   (when (and nondummy.arg
-             (~in ty.arg.0 'literal 'offset 'fn)
+             (~literal? arg)
              (~location v.arg)
              (isa v.arg 'sym)
              (~in v.arg 'nil 'default-scope)