action: update 'reads_from' field before synchronization
authorBrian Norris <banorris@uci.edu>
Mon, 20 Aug 2012 22:59:25 +0000 (15:59 -0700)
committerBrian Norris <banorris@uci.edu>
Thu, 23 Aug 2012 01:36:50 +0000 (18:36 -0700)
As the ModelChecker's release/acquire functionality gets more complex,
it makes more sense to assign the ModelAction::reads_from field before
checking synchronization. Currently, this makes no change in behavior.

action.cc

index 5c036ef..b9e9c02 100644 (file)
--- a/action.cc
+++ b/action.cc
@@ -165,10 +165,10 @@ void ModelAction::create_cv(const ModelAction *parent)
 void ModelAction::read_from(const ModelAction *act)
 {
        ASSERT(cv);
+       reads_from = act;
        if (act!=NULL && act->is_release() && this->is_acquire()) {
                synchronize_with(act);
        }
-       reads_from = act;
 }
 
 /**