From: Brian Norris Date: Sat, 2 Mar 2013 02:49:29 +0000 (-0800) Subject: model: check_recency: convert a few things to ASSERT() X-Git-Tag: oopsla2013~186 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=c4c6c997cb5d2d651d4dfa76390a42592432d266;hp=20c377062e4cfe1c12d517c059822229bacc8c20;p=model-checker.git model: check_recency: convert a few things to ASSERT() At least for now, just to make sure my reasoning is correct. --- diff --git a/model.cc b/model.cc index 4ae6966..d523fc2 100644 --- 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; + std::vector *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::reverse_iterator rit = list->rbegin(); + ASSERT((*rit) == curr); /* Skip past curr */ - for (; (*rit) != curr; rit++) - ; - /* go past curr now */ rit++; action_list_t::reverse_iterator ritcopy = rit;