diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2021-05-30 18:02:40 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2021-05-30 18:02:40 -0700 |
commit | 067fa9c725e8afd1ce2e07264a900703fb30dba9 (patch) | |
tree | a092dbecd72ac527f7899be707fe73fd460fe1c6 /shell/trace.mu | |
parent | 961ce67569ae5b0285f7e12d15652f98ef17d9b4 (diff) | |
download | mu-067fa9c725e8afd1ce2e07264a900703fb30dba9.tar.gz |
bugfix: unbound variables were not raising error
Since we switched error trace semantics from a designated label to a designated depth (commit 9831a8cef9 on May 19).
Diffstat (limited to 'shell/trace.mu')
-rw-r--r-- | shell/trace.mu | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/shell/trace.mu b/shell/trace.mu index 22c01269..85ca117b 100644 --- a/shell/trace.mu +++ b/shell/trace.mu @@ -195,6 +195,20 @@ fn error _self: (addr trace), message: (addr array byte) { copy-to *curr-depth-a, save-depth } +fn error-stream _self: (addr trace), message: (addr stream byte) { + var self/esi: (addr trace) <- copy _self + compare self, 0 + { + break-if-!= + abort "null trace" + } + var curr-depth-a/eax: (addr int) <- get self, curr-depth + var save-depth/ecx: int <- copy *curr-depth-a + copy-to *curr-depth-a, 0/error + trace self, "error", message + copy-to *curr-depth-a, save-depth +} + fn initialize-trace-line depth: int, label: (addr array byte), data: (addr stream byte), _out: (addr trace-line) { var out/edi: (addr trace-line) <- copy _out # depth |