about summary refs log tree commit diff stats
path: root/091run_interactive.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-11-18 11:30:54 -0800
committerKartik K. Agaram <vc@akkartik.com>2015-11-18 11:35:24 -0800
commit322ce34d77b4e2d8c6d721b156c02496d105741f (patch)
tree29e4556b502d24380126a1503203289d2293b8d0 /091run_interactive.cc
parent5967e82fab9feea381dd1b6e1925177e771d86dc (diff)
downloadmu-322ce34d77b4e2d8c6d721b156c02496d105741f.tar.gz
2458 - edit/: recipe side free of sandbox errors
This is happening because of our recent generic changes, which trigger
some post-processing transforms on all recipes even if we processed them
before. We could clear 'interactive' inside 'reload' to avoid this, but
random 'run' blocks in scenarios can still pick up errors from sandboxes
earlier in a scenario. The right place to clear the 'interactive' recipe
is right after we use it, in run_code_end().
Diffstat (limited to '091run_interactive.cc')
-rw-r--r--091run_interactive.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/091run_interactive.cc b/091run_interactive.cc
index 25e02836..a883a5ae 100644
--- a/091run_interactive.cc
+++ b/091run_interactive.cc
@@ -107,6 +107,7 @@ bool run_interactive(long long int address) {
 }
 
 void run_code_begin() {
+//?   cerr << "loading new trace\n";
   // stuff to undo later, in run_code_end()
   Hide_warnings = true;
   Hide_errors = true;
@@ -119,6 +120,7 @@ void run_code_begin() {
 }
 
 void run_code_end() {
+//?   cerr << "back to old trace\n";
   Hide_warnings = false;
   Hide_errors = false;
   Disable_redefine_warnings = false;
@@ -127,6 +129,7 @@ void run_code_end() {
   Save_trace_stream = NULL;
   Trace_file = Save_trace_file;
   Save_trace_file.clear();
+  Recipe.erase(get(Recipe_ordinal, "interactive"));  // keep past sandboxes from inserting errors
 }
 
 :(before "End Load Recipes")
@@ -417,6 +420,7 @@ case RELOAD: {
 }
 :(before "End Primitive Recipe Implementations")
 case RELOAD: {
+//?   cerr << "== reload\n";
   // clear any containers in advance
   for (long long int i = 0; i < SIZE(recently_added_types); ++i) {
     Type_ordinal.erase(get(Type, recently_added_types.at(i)).name);
@@ -427,15 +431,17 @@ case RELOAD: {
   routine* save_current_routine = Current_routine;
   Current_routine = NULL;
   vector<recipe_ordinal> recipes_reloaded = load(code);
-  for (long long int i = 0; i < SIZE(recipes_reloaded); ++i) {
+  // clear a few things from previous runs
+  // ad hoc list; we've probably missed a few
+  for (long long int i = 0; i < SIZE(recipes_reloaded); ++i)
     Name.erase(recipes_reloaded.at(i));
-  }
   transform_all();
   Trace_stream->newline();  // flush trace
   Current_routine = save_current_routine;
   products.resize(1);
   products.at(0).push_back(trace_error_warning_contents());
   run_code_end();  // wait until we're done with the trace contents
+//?   cerr << "reload done\n";
   break;
 }