did a little more looking at infeasible executions...
[model-checker.git] / model.cc
index e11dcf716939e1a13f1dd08f6b252ab60fef1b9b..ee3ce992cef8aa816fde0466ce67b42e5f6161c5 100644 (file)
--- a/model.cc
+++ b/model.cc
@@ -1779,6 +1779,11 @@ void ModelChecker::mo_check_promises(thread_id_t tid, const ModelAction *write)
                        //do we have a pwrite for the promise, if not, set it
                        if (promise->get_write() == NULL ) {
                                promise->set_write(write);
+                               //The pwrite cannot happen before the promise
+                               if (write->happens_before(act) && (write != act)) {
+                                       failed_promise = true;
+                                       return;
+                               }
                        }
                        if (mo_graph->checkPromise(write, promise)) {
                                failed_promise = true;