model: check_recency: convert a few things to ASSERT()
[model-checker.git] / nodestack.cc
index 131b06ca6fe1d190ed56f74577676cc81cc3b069..515a2d313abbee54abbd132057100c89f9f711fc 100644 (file)
@@ -285,6 +285,7 @@ void Node::clear_backtracking()
                backtrack[i] = false;
        for (unsigned int i = 0; i < explored_children.size(); i++)
                explored_children[i] = false;
+       numBacktracks = 0;
 }
 
 bool Node::is_enabled(Thread *t) const
@@ -455,10 +456,9 @@ void Node::add_read_from_promise(const ModelAction *reader)
  * where this->action is a 'read'.
  * @return The current element in read_from_promises
  */
-const Promise * Node::get_read_from_promise() const
+Promise * Node::get_read_from_promise() const
 {
-       if (read_from_promise_idx < 0 || read_from_promise_idx >= ((int)read_from_promises.size()))
-               return NULL;
+       ASSERT(read_from_promise_idx >= 0 && read_from_promise_idx < ((int)read_from_promises.size()));
        return read_from_promises[read_from_promise_idx]->get_reads_from_promise();
 }