X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=common.cc;h=f4aa7ecefa023417c7eec4680e38e1c25a5cc13b;hb=refs%2Ftags%2Fpldi2013;hp=b274989f48bc4d885f6976b596139b1e5bde42ed;hpb=a1e702259b91aaa78fd6d60bb9c54cbfc47af279;p=model-checker.git diff --git a/common.cc b/common.cc index b274989..f4aa7ec 100644 --- a/common.cc +++ b/common.cc @@ -2,6 +2,8 @@ #include #include +#include + #include "common.h" #include "model.h" #include "stacktrace.h" @@ -40,3 +42,13 @@ void assert_hook(void) { printf("Add breakpoint to line %u in file %s.\n",__LINE__,__FILE__); } + +void model_assert(bool expr, const char *file, int line) +{ + if (!expr) { + printf(" [BUG] Program has hit assertion in file %s at line %d\n", + file, line); + model->set_assert(); + model->switch_to_master(NULL); + } +}