model: refactor to use a helper function
authorBrian Norris <banorris@uci.edu>
Wed, 6 Feb 2013 23:46:23 +0000 (15:46 -0800)
committerBrian Norris <banorris@uci.edu>
Wed, 6 Feb 2013 23:46:23 +0000 (15:46 -0800)
model.cc

index 2b8ab3cc870a6f0fc9dae9ec5758f7b2e00f8092..15718e1fe32a498a4d9d1c7b651c35a4c8b5f281 100644 (file)
--- a/model.cc
+++ b/model.cc
@@ -2393,13 +2393,12 @@ void ModelChecker::check_promises_thread_disabled()
  */
 void ModelChecker::mo_check_promises(thread_id_t tid, const ModelAction *write, const ModelAction *read)
 {
-       void *location = write->get_location();
        for (unsigned int i = 0; i < promises->size(); i++) {
                Promise *promise = (*promises)[i];
                const ModelAction *act = promise->get_action();
 
                // Is this promise on the same location?
-               if (act->get_location() != location)
+               if (!act->same_var(write))
                        continue;
 
                // same thread as the promise