From ed16499d4471e6177a08fb93f33da24465574b63 Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Sat, 2 Mar 2013 14:04:08 -0800 Subject: [PATCH] model: refactor process_read logic --- model.cc | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/model.cc b/model.cc index 9e476a95..63ff3638 100644 --- a/model.cc +++ b/model.cc @@ -864,21 +864,20 @@ bool ModelChecker::process_read(ModelAction *curr) mo_graph->startChanges(); ASSERT(!is_infeasible()); - if (!check_recency(curr, rf)) - priv->too_many_reads = true; - updated = r_modification_order(curr, rf); - - if (is_infeasible() && node->increment_read_from()) { - mo_graph->rollbackChanges(); - priv->too_many_reads = false; - continue; + if (!check_recency(curr, rf)) { + if (node->increment_read_from()) { + mo_graph->rollbackChanges(); + continue; + } else { + priv->too_many_reads = true; + } } + updated = r_modification_order(curr, rf); value = rf->get_value(); read_from(curr, rf); mo_graph->commitChanges(); mo_check_promises(curr, true); - break; } case READ_FROM_PROMISE: { -- 2.34.1