about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-03-08 16:30:07 -0700
committerKartik Agaram <vc@akkartik.com>2020-03-08 16:30:07 -0700
commitb5615912fa5f9f48f08711d9f7f2d9eecaa0d837 (patch)
tree0254d4169a8a9037c02d9855fc30bfec31fb987f
parente33feb03a0f37e505ed53032f45d85f817b124ad (diff)
downloadmu-b5615912fa5f9f48f08711d9f7f2d9eecaa0d837.tar.gz
6105
Create space for another local.
-rwxr-xr-xapps/mubin183193 -> 183198 bytes
-rw-r--r--apps/mu.subx15
2 files changed, 9 insertions, 6 deletions
diff --git a/apps/mu b/apps/mu
index df823788..d2924053 100755
--- a/apps/mu
+++ b/apps/mu
Binary files differdiff --git a/apps/mu.subx b/apps/mu.subx
index c8afbc90..5c252241 100644
--- a/apps/mu.subx
+++ b/apps/mu.subx
@@ -5599,6 +5599,7 @@ $find-or-create-typeinfo-fields:end:
 populate-mu-type:  # in: (addr stream byte), t: (handle typeinfo)
     # pseudocode:
     #   var line: (stream byte 512)
+    #   curr-index = 0
     #   curr-offset = 0
     #   while true
     #     clear-stream(line)
@@ -5623,7 +5624,9 @@ populate-mu-type:  # in: (addr stream byte), t: (handle typeinfo)
     # . prologue
     55/push-ebp
     89/<- %ebp 4/r32/esp
-    # var curr-offset: int at *(ebp-4) for memorability
+    # var curr-index: int at *(ebp-4)
+    68/push 0/imm32
+    # var curr-offset: int at *(ebp-8) for memorability
     68/push 0/imm32
     # . save registers
     50/push-eax
@@ -5692,16 +5695,16 @@ $populate-mu-type:set-output-offset:
       # var ov/ebx: (handle var) = r->output-var
       8b/-> *(eax+8) 3/r32/ebx  # Typeinfo-entry-output-var
       # ov->offset = curr-offset
-      8b/-> *(ebp-4) 0/r32/eax
+      8b/-> *(ebp-8) 0/r32/eax
       89/<- *(ebx+0xc) 0/r32/eax
       # curr-offset += size-of(v)
       (size-of %esi)  # => eax
-      01/add-to *(ebp-4) 0/r32/eax
+      01/add-to *(ebp-8) 0/r32/eax
       #
       e9/jump loop/disp32
     }
     # persist the total size of the type
-    8b/-> *(ebp-4) 0/r32/eax
+    8b/-> *(ebp-8) 0/r32/eax
     89/<- *(edi+8) 0/r32/eax  # Typeinfo-total-size-in-bytes
 $populate-mu-type:end:
     # . reclaim locals
@@ -5713,8 +5716,8 @@ $populate-mu-type:end:
     5a/pop-to-edx
     59/pop-to-ecx
     58/pop-to-eax
-    # reclaim curr-offset
-    81 0/subop/add %esp 4/imm32
+    # reclaim curr-offset and curr-index
+    81 0/subop/add %esp 8/imm32
     # . epilogue
     89/<- %esp 5/r32/ebp
     5d/pop-to-ebp