about summary refs log tree commit diff stats
path: root/apps
diff options
context:
space:
mode:
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: