about summary refs log tree commit diff stats
path: root/subx/010---vm.cc
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2019-04-12 10:51:33 -0700
committerKartik Agaram <vc@akkartik.com>2019-04-12 10:59:43 -0700
commitfb2ffbd0960d8e9a9e8fd9daa9dc688405016ba2 (patch)
tree3912dc655f1a2924b379dd05acf322da4fc89640 /subx/010---vm.cc
parent61b8fe6b18c6314268ed24d79bf99de6f55be63b (diff)
downloadmu-fb2ffbd0960d8e9a9e8fd9daa9dc688405016ba2.tar.gz
5085 - 'assort' phase done!
Current plan for SubX translator:

  $ cat files.subx ... |assort |pack |survey |hex > a.out

Higher-level notations will be inserted at the start of the pipeline. The
first (and needed for bootstrapping) is for string literals.

  $ cat files.subx ... |string-literals |assort |pack |survey |hex > a.out

Alternatively, we should check how often we use string literals and just
convert them by hand.

They're used all over in tests, and converting them would make tests hard
(even harder) to read.
Diffstat (limited to 'subx/010---vm.cc')
-rw-r--r--subx/010---vm.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/subx/010---vm.cc b/subx/010---vm.cc
index 9fbecbc0..6fac9cf7 100644
--- a/subx/010---vm.cc
+++ b/subx/010---vm.cc
@@ -223,8 +223,10 @@ inline uint8_t* mem_addr_u8(uint32_t addr) {
       result = &Mem.at(i).data(addr);
     }
   }
-  if (result == NULL)
+  if (result == NULL) {
+    if (Trace_file) Trace_file.flush();
     raise << "Tried to access uninitialized memory at address 0x" << HEXWORD << addr << '\n' << end();
+  }
   return result;
 }
 inline int8_t* mem_addr_i8(uint32_t addr) {