about summary refs log tree commit diff stats
path: root/apps/tile/rpn.mu
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-11-02 19:50:34 -0800
committerKartik Agaram <vc@akkartik.com>2020-11-02 19:50:52 -0800
commita3f779158626b9ad3c81959b85cbfbbce17425fd (patch)
tree10c9da6ee8783a2ed2a3e6e928fb5d70024d1bcc /apps/tile/rpn.mu
parent951c3f4c92358d3962154a4ef24a19366ea8a619 (diff)
downloadmu-a3f779158626b9ad3c81959b85cbfbbce17425fd.tar.gz
7159 - explicitly use 'return' everywhere
https://github.com/akkartik/mu/issues/45#issuecomment-719990879, task 2.
Diffstat (limited to 'apps/tile/rpn.mu')
-rw-r--r--apps/tile/rpn.mu5
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/tile/rpn.mu b/apps/tile/rpn.mu
index e2c7aeef..0a8f9fc5 100644
--- a/apps/tile/rpn.mu
+++ b/apps/tile/rpn.mu
@@ -560,10 +560,10 @@ fn bind-args _callee: (addr function), _caller-stack: (addr value-stack), table:
 
 # Copy of 'simplify' that just tracks the maximum stack depth needed
 # Doesn't actually need to simulate the stack, since every word has a predictable effect.
-fn max-stack-depth first-word: (addr word), final-word: (addr word) -> result/edi: int {
+fn max-stack-depth first-word: (addr word), final-word: (addr word) -> _/edi: int {
   var curr-word/eax: (addr word) <- copy first-word
   var curr-depth/ecx: int <- copy 0
-  result <- copy 0
+  var result/edi: int <- copy 0
   $max-stack-depth:loop: {
     $max-stack-depth:process-word: {
       # handle operators
@@ -606,4 +606,5 @@ fn max-stack-depth first-word: (addr word), final-word: (addr word) -> result/ed
     #
     loop
   }
+  return result
 }