nodestack: remove unnecessary conditional
authorBrian Norris <banorris@uci.edu>
Mon, 14 May 2012 19:46:14 +0000 (12:46 -0700)
committerBrian Norris <banorris@uci.edu>
Mon, 14 May 2012 20:30:43 +0000 (13:30 -0700)
I expect that we should never have a totally-empty NodeStack. It is designed
such that there is a stub 'empty' node that represents the choices at the start
of the program, when the first userprogram thread is 'created' (note: there is
no corresponding ModelAction for this first creation).

nodestack.cc

index 7cef4b670065e21456e2e5758e61aaa0c4a3c854..379fb3b1fc15f219cdd870b4976af0e394fd2263 100644 (file)
@@ -124,10 +124,10 @@ void NodeStack::print()
 ModelAction * NodeStack::explore_action(ModelAction *act)
 {
        DBG();
-       if (node_list.empty()) {
-               node_list.push_back(new Node(act));
-               iter = node_list.begin();
-       } else if (get_head()->has_been_explored(act->get_tid())) {
+
+       ASSERT(!node_list.empty());
+
+       if (get_head()->has_been_explored(act->get_tid())) {
                /* Discard duplicate ModelAction */
                delete act;
                iter++;