From: Brian Norris Date: Wed, 6 Feb 2013 23:46:23 +0000 (-0800) Subject: model: refactor to use a helper function X-Git-Tag: oopsla2013~275 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=4101d47a1d3bd1f94612b3cec799ae28e277e217;p=model-checker.git model: refactor to use a helper function --- diff --git a/model.cc b/model.cc index 2b8ab3c..15718e1 100644 --- 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