From: Brian Norris Date: Thu, 12 Jul 2012 18:05:20 +0000 (-0700) Subject: model: bugfix - resize thrd_last_action when adding objects X-Git-Tag: pldi2013~363^2 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ddc42efe21d50de5a6a70f82d0e45d5eea29f5fd;p=model-checker.git model: bugfix - resize thrd_last_action when adding objects Apparently, STL vectors don't resize automatically, nor do they warn or print errors when you access them out-of-bounds... --- diff --git a/model.cc b/model.cc index e579105..cde6213 100644 --- a/model.cc +++ b/model.cc @@ -291,6 +291,8 @@ void ModelChecker::add_action_to_lists(ModelAction *act) vec->resize(next_thread_id); (*vec)[tid].push_back(act); + if ((int)thrd_last_action->size() <= tid) + thrd_last_action->resize(get_num_threads()); (*thrd_last_action)[tid] = act; }