about summary refs log tree commit diff stats
path: root/apps
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-03-11 17:25:41 -0700
committerKartik Agaram <vc@akkartik.com>2020-03-11 17:30:06 -0700
commitf2d6bb1cb8dc95bfd2e268c94e3aec3855b7c81b (patch)
tree5acc2774c5f61a8896883bf530618f3644905dd5 /apps
parent28746b36660093dcbf53667f4f67320d278359ea (diff)
downloadmu-f2d6bb1cb8dc95bfd2e268c94e3aec3855b7c81b.tar.gz
6124
Diffstat (limited to 'apps')
-rwxr-xr-xapps/mubin187282 -> 187294 bytes
-rw-r--r--apps/mu.subx10
2 files changed, 8 insertions, 2 deletions
diff --git a/apps/mu b/apps/mu
index 883a9bea..86f19f7a 100755
--- a/apps/mu
+++ b/apps/mu
Binary files differdiff --git a/apps/mu.subx b/apps/mu.subx
index 8ac7ba77..34e5419c 100644
--- a/apps/mu.subx
+++ b/apps/mu.subx
@@ -6109,10 +6109,16 @@ size-of:  # v: (handle var) -> result/eax: int
     89/<- %ebp 4/r32/esp
     # . save registers
     51/push-ecx
-    # ecx = v->type
+    # var t/ecx: (handle tree type-id) = v->type
     8b/-> *(ebp+8) 1/r32/ecx
     8b/-> *(ecx+4) 1/r32/ecx  # Var-type
-    # TODO: support non-atom type
+    # if (t->left >= *Max-type-id) t = t->left
+    {
+      8b/-> *Max-type-id 0/r32/eax
+      39/compare *ecx 0/r32/eax  # Tree-left
+      72/jump-if-addr< break/disp8
+      8b/-> *ecx 1/r32/ecx  # Tree-left
+    }
     # TODO: support arrays
     (size-of-type-id *ecx)  # Atom-left => eax
 $size-of:end: