Fix typo
[c11tester.git] / history.cc
index 19354d7475e171749ed4fc413f8e67c289181047..c9c6ff6f06192cb318f8e5640ad4d84d5a522b54 100644 (file)
 /** @brief Constructor */
 ModelHistory::ModelHistory() :
        func_counter(1),        /* function id starts with 1 */
+       last_seq_number(INIT_SEQ_NUMBER),
        func_map(),
        func_map_rev(),
-       func_nodes(),
-       last_action(NULL)
+       func_nodes()
 {
        /* The following are snapshot data structures */
        write_history = new HashTable<void *, value_set_t *, uintptr_t, 0>();
@@ -148,7 +148,7 @@ void ModelHistory::process_action(ModelAction *act, thread_id_t tid)
        func_node->add_inst(act);
 
        func_node->update_tree(act);
-       last_action = act;
+       last_seq_number = act->get_seq_number();
 }
 
 /* Return the FuncNode given its func_id  */
@@ -391,10 +391,8 @@ bool ModelHistory::skip_action(ModelAction * act)
                return true;
 
        /* Skip actions with the same sequence number */
-       if (last_action != NULL) {
-               if (last_action->get_seq_number() == curr_seq_number)
-                       return true;
-       }
+       if (last_seq_number != INIT_SEQ_NUMBER && last_seq_number == curr_seq_number)
+               return true;
 
        /* Skip actions that are paused by fuzzer (sequence number is 0) */
        if (curr_seq_number == 0)