model: bugfix - adding a Promise reader can cause failure
authorBrian Norris <banorris@uci.edu>
Sat, 2 Mar 2013 23:03:58 +0000 (15:03 -0800)
committerBrian Norris <banorris@uci.edu>
Sat, 2 Mar 2013 23:03:58 +0000 (15:03 -0800)
model.cc

index aba71772fde8638892165bf9775df78be30f2819..38d08d988e198e37a5f136a1b44988892ee4c3d7 100644 (file)
--- a/model.cc
+++ b/model.cc
@@ -882,7 +882,8 @@ bool ModelChecker::process_read(ModelAction *curr)
                }
                case READ_FROM_PROMISE: {
                        Promise *promise = curr->get_node()->get_read_from_promise();
-                       promise->add_reader(curr);
+                       if (promise->add_reader(curr))
+                               priv->failed_promise = true;
                        value = promise->get_value();
                        curr->set_read_from_promise(promise);
                        mo_graph->startChanges();