Two change:
authorBrian Demsky <bdemsky@uci.edu>
Tue, 2 Oct 2012 04:48:34 +0000 (21:48 -0700)
committerBrian Demsky <bdemsky@uci.edu>
Tue, 2 Oct 2012 04:48:34 +0000 (21:48 -0700)
(1) Bug fix...  Check that rf is non-null before calling
r_modification

(2) Add a hook into assert mechanism for the debugger

common.cc
common.h
model.cc

index ac5cb59..e05e094 100644 (file)
--- a/common.cc
+++ b/common.cc
@@ -29,3 +29,8 @@ void model_print_summary(void)
 {
        model->print_summary();
 }
+
+void assert_hook(void)
+{
+       printf("Add breakpoint to line %u in file %s.\n",__LINE__,__FILE__);
+}
index 2dc8b7d..003dc80 100644 (file)
--- a/common.h
+++ b/common.h
 #define DBG_ENABLED() (0)
 #endif
 
+void assert_hook(void);
+
 #define ASSERT(expr) \
 do { \
        if (!(expr)) { \
                fprintf(stderr, "Error: assertion failed in %s at line %d\n", __FILE__, __LINE__); \
                print_trace(); \
                model_print_summary(); \
+               assert_hook();                           \
                exit(EXIT_FAILURE); \
        } \
 } while (0);
@@ -32,5 +35,4 @@ do { \
 
 void print_trace(void);
 void model_print_summary(void);
-
 #endif /* __COMMON_H__ */
index 9dc1d37..a22e021 100644 (file)
--- a/model.cc
+++ b/model.cc
@@ -658,7 +658,8 @@ Thread * ModelChecker::check_current_action(ModelAction *curr)
                        bool updated = false;
 
                        if (act->is_read()) {
-                               if (r_modification_order(act, act->get_reads_from()))
+                               const ModelAction *rf = act->get_reads_from();
+                               if (rf != NULL && r_modification_order(act, rf))
                                        updated = true;
                        }
                        if (act->is_write()) {