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 ac5cb59601ba7a6025ac1d8d5f24f62fef0666b7..e05e094ea0105a9c2ce8e221cf95a1613d21074b 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 2dc8b7d9e8e59457fd4bfee6b850af028414d9c9..003dc805e180e5cc2c790329ec042ef66d6d120f 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 9dc1d37c71bb6ac93844d057efd7928818d7e053..a22e0214a6c2a3fdabd01a5442b3cba6643c616d 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()) {