model: check_recency: convert a few things to ASSERT()
authorBrian Norris <banorris@uci.edu>
Sat, 2 Mar 2013 02:49:29 +0000 (18:49 -0800)
committerBrian Norris <banorris@uci.edu>
Sat, 2 Mar 2013 02:49:29 +0000 (18:49 -0800)
At least for now, just to make sure my reasoning is correct.

model.cc

index 4ae69665e4b84e3b04c2e852a120e85271c9c3c0..d523fc29ad786a861d0eca41eb0a3bd93dfa4991 100644 (file)
--- a/model.cc
+++ b/model.cc
@@ -1663,20 +1663,14 @@ void ModelChecker::check_recency(ModelAction *curr, const ModelAction *rf)
         * accidentally clear by rolling back */
        if (is_infeasible())
                return;
         * accidentally clear by rolling back */
        if (is_infeasible())
                return;
+
        std::vector<action_list_t> *thrd_lists = get_safe_ptr_vect_action(obj_thrd_map, curr->get_location());
        int tid = id_to_int(curr->get_tid());
        std::vector<action_list_t> *thrd_lists = get_safe_ptr_vect_action(obj_thrd_map, curr->get_location());
        int tid = id_to_int(curr->get_tid());
-
-       //NOTE: this check seems left over from previous approach that added action to list late in the game...should be safe to remove
-       /* Skip checks */
-       if ((int)thrd_lists->size() <= tid)
-               return;
+       ASSERT(tid < (int)thrd_lists->size());
        action_list_t *list = &(*thrd_lists)[tid];
        action_list_t *list = &(*thrd_lists)[tid];
-
        action_list_t::reverse_iterator rit = list->rbegin();
        action_list_t::reverse_iterator rit = list->rbegin();
+       ASSERT((*rit) == curr);
        /* Skip past curr */
        /* Skip past curr */
-       for (; (*rit) != curr; rit++)
-               ;
-       /* go past curr now */
        rit++;
 
        action_list_t::reverse_iterator ritcopy = rit;
        rit++;
 
        action_list_t::reverse_iterator ritcopy = rit;