cyclegraph: expand template usage
[model-checker.git] / model.cc
index 9d7ff51431a1b358914dd3f49e8d8c02ee226a9d..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
@@ -2577,7 +2576,7 @@ void ModelChecker::dumpGraph(char *filename) const
        for (action_list_t::iterator it = action_trace->begin(); it != action_trace->end(); it++) {
                ModelAction *action = *it;
                if (action->is_read()) {
-                       fprintf(file, "N%u [label=\"%u, T%u\"];\n", action->get_seq_number(), action->get_seq_number(), action->get_tid());
+                       fprintf(file, "N%u [label=\"N%u, T%u\"];\n", action->get_seq_number(), action->get_seq_number(), action->get_tid());
                        if (action->get_reads_from() != NULL)
                                fprintf(file, "N%u -> N%u[label=\"rf\", color=red];\n", action->get_seq_number(), action->get_reads_from()->get_seq_number());
                }