about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-02-02 08:01:35 -0800
committerKartik Agaram <vc@akkartik.com>2020-02-02 08:01:35 -0800
commitd624175a2afd64c2cace812f871751926023fde8 (patch)
treee3011e42bb88251e0a3dca17171fc82fccde14d1
parent8099ed348d042362b5548551a51a4e3a12af4420 (diff)
downloadmu-d624175a2afd64c2cace812f871751926023fde8.tar.gz
5978
-rw-r--r--apps/mu.subx5
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/mu.subx b/apps/mu.subx
index 5119f5b7..e34ce6ac 100644
--- a/apps/mu.subx
+++ b/apps/mu.subx
@@ -2823,7 +2823,8 @@ $populate-mu-function-body:end:
 
 == data
 
-# Global state when parsing a function
+# Global state added to each var record when parsing a function
+
 Curr-block-depth:  # (addr int)
     0/imm32
 Next-local-stack-offset:  # (addr int)
@@ -4150,6 +4151,8 @@ emit-subx-function:  # out: (addr buffered-file), f: (handle function)
     #
     (write-buffered %edi *ecx)
     (write-buffered %edi ":\n")
+    # Important: each block's depth during code-generation should be identical
+    # to what it was during parsing.
     c7 0/subop/copy *Curr-block-depth 1/imm32
     (emit-subx-prologue %edi)
     (emit-subx-block %edi *(ecx+0x10) %edx)  # Function-body