From d624175a2afd64c2cace812f871751926023fde8 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Sun, 2 Feb 2020 08:01:35 -0800 Subject: 5978 --- apps/mu.subx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'apps') 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 -- cgit 1.4.1-2-gfad0