about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-08-18 11:20:33 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-08-18 11:20:33 -0700
commit4588af9793a486a46fe04d1d67ab083b242db1a7 (patch)
tree768e392c56835b335a2e03d7fab56d9b7c025087
parent72d868e6460e9189ab6ca9b4f4feae3d58db6f80 (diff)
downloadmu-4588af9793a486a46fe04d1d67ab083b242db1a7.tar.gz
3223
-rw-r--r--020run.cc5
-rw-r--r--035lookup.cc4
2 files changed, 4 insertions, 5 deletions
diff --git a/020run.cc b/020run.cc
index 6a68e360..5d511d66 100644
--- a/020run.cc
+++ b/020run.cc
@@ -289,7 +289,10 @@ void write_memory(reagent/*copy*/ x, const vector<double>& data) {
   if (is_dummy(x)) return;
   if (is_literal(x)) return;
   // End Preprocess write_memory(x, data)
-  if (x.value == 0) return;
+  if (x.value == 0) {
+    raise << "can't write to location 0 in '" << to_original_string(current_instruction()) << "'\n" << end();
+    return;
+  }
   if (size_mismatch(x, data)) {
     raise << maybe(current_recipe_name()) << "size mismatch in storing to '" << x.original_string << "' (" << size_of(x) << " vs " << SIZE(data) << ") at '" << to_original_string(current_instruction()) << "'\n" << end();
     return;
diff --git a/035lookup.cc b/035lookup.cc
index 0c9e1543..54dee6e3 100644
--- a/035lookup.cc
+++ b/035lookup.cc
@@ -56,10 +56,6 @@ def main [
 
 :(before "End Preprocess write_memory(x, data)")
 canonize(x);
-if (x.value == 0) {
-  raise << "can't write to location 0 in '" << to_original_string(current_instruction()) << "'\n" << end();
-  return;
-}
 
 //: writes to address 0 always loudly fail
 :(scenario store_to_0_fails)