From c4c6c997cb5d2d651d4dfa76390a42592432d266 Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Fri, 1 Mar 2013 18:49:29 -0800 Subject: [PATCH] model: check_recency: convert a few things to ASSERT() At least for now, just to make sure my reasoning is correct. --- model.cc | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/model.cc b/model.cc index 4ae69665..d523fc29 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; -- 2.34.1