From ddc42efe21d50de5a6a70f82d0e45d5eea29f5fd Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Thu, 12 Jul 2012 11:05:20 -0700 Subject: [PATCH] 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... --- model.cc | 2 ++ 1 file changed, 2 insertions(+) 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; } -- 2.34.1