From: Brian Norris Date: Thu, 21 Mar 2013 23:48:57 +0000 (-0700) Subject: model: re-check pending future values whenever a promise is resolved X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=d38fde1f52b826ebb760236bdd5f23f69069ede9;p=c11tester.git model: re-check pending future values whenever a promise is resolved This is the second part of the previous bugfix; now we must also allow stashed pending future values to be re-checked in case a promise has been resolved which now allows sending the value. --- diff --git a/model.cc b/model.cc index a9d90914..167ea947 100644 --- a/model.cc +++ b/model.cc @@ -1139,12 +1139,13 @@ bool ModelChecker::process_write(ModelAction *curr) } } - if (promises->empty()) { - for (unsigned int i = 0; i < futurevalues->size(); i++) { - struct PendingFutureValue pfv = (*futurevalues)[i]; + /* Check the pending future values */ + for (int i = (int)futurevalues->size() - 1; i >= 0; i--) { + struct PendingFutureValue pfv = (*futurevalues)[i]; + if (promises_may_allow(pfv.writer, pfv.reader)) { add_future_value(pfv.writer, pfv.reader); + futurevalues->erase(futurevalues->begin() + i); } - futurevalues->clear(); } mo_graph->commitChanges();