about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-05-28 21:44:42 -0700
committerKartik Agaram <vc@akkartik.com>2020-05-28 21:45:27 -0700
commit5cccde6a9c8138e74bbe193eeb98752e8006d702 (patch)
tree1ff87a354454190fde1d3f8776db735d6839c84c
parent3962ac59596919422c0c63d08f9ac1a718a266b0 (diff)
downloadmu-5cccde6a9c8138e74bbe193eeb98752e8006d702.tar.gz
6420
Starting to feel the need for more static checks, like when I must use a
register, or when a variable has been clobbered.

The good news: I thought I'd found a bug in apps/mu, but I hadn't.
-rw-r--r--apps/cat.mu7
1 files changed, 5 insertions, 2 deletions
diff --git a/apps/cat.mu b/apps/cat.mu
index 13bf007c..5010bafb 100644
--- a/apps/cat.mu
+++ b/apps/cat.mu
@@ -4,7 +4,7 @@
 fn main _args: (addr array (addr array byte)) -> exit-status/ebx: int {
   var args/eax: (addr array (addr array byte)) <- copy _args
 $main-body: {
-    var n/eax: int <- length args
+    var n/ecx: int <- length args
     compare n, 1
     {
       break-if->
@@ -13,7 +13,10 @@ $main-body: {
     }
     {
       break-if-<=
-      print-string "success\n"
+      var filename/edx: (addr addr array byte) <- index args 1
+      print-string "filename: "
+      print-string *filename
+      print-string "\n"
     }
   }
   exit-status <- copy 0