common: early quit on MODEL_ASSERT()
authorBrian Norris <banorris@uci.edu>
Sun, 4 Nov 2012 00:50:26 +0000 (17:50 -0700)
committerBrian Norris <banorris@uci.edu>
Sun, 4 Nov 2012 00:50:26 +0000 (17:50 -0700)
If a user program hits an assertion, we should quit before executing any
further. i.e., don't even wait for the next atomic action, since the
assertion might trigger more bugs that have unintended/unforseen
consequences.

common.cc

index 20102b0bba76ecee78f3491302b5768967c482a2..f4aa7ecefa023417c7eec4680e38e1c25a5cc13b 100644 (file)
--- a/common.cc
+++ b/common.cc
@@ -49,5 +49,6 @@ void model_assert(bool expr, const char *file, int line)
                printf("  [BUG] Program has hit assertion in file %s at line %d\n",
                                file, line);
                model->set_assert();
+               model->switch_to_master(NULL);
        }
 }