action: include reads-from-promise in HASH calculations
authorBrian Norris <banorris@uci.edu>
Thu, 4 Apr 2013 17:10:32 +0000 (10:10 -0700)
committerBrian Norris <banorris@uci.edu>
Thu, 4 Apr 2013 17:29:54 +0000 (10:29 -0700)
And include the *value*, since the same promise index can yield
different future values.

action.cc

index d425b6030f9cdaaccc928b75ddad9169bcb4f70a..34bc09f0be567c3ff4b30e084e52d911b12fd8cc 100644 (file)
--- a/action.cc
+++ b/action.cc
@@ -630,8 +630,13 @@ unsigned int ModelAction::hash() const
        hash ^= seq_number << 5;
        hash ^= id_to_int(tid) << 6;
 
        hash ^= seq_number << 5;
        hash ^= id_to_int(tid) << 6;
 
-       if (is_read() && reads_from)
-               hash ^= reads_from->get_seq_number();
+       if (is_read()) {
+              if (reads_from)
+                      hash ^= reads_from->get_seq_number();
+              else if (reads_from_promise)
+                      hash ^= model->get_promise_number(reads_from_promise);
+              hash ^= get_reads_from_value();
+       }
        return hash;
 }
 
        return hash;
 }