model: bugfix - resize thrd_last_action when adding objects
[model-checker.git] / model.cc
index e579105768b5eff8e84ae9f252b4605c058fbfa3..cde6213ada34c0b3c6a9a5328474ddcf9371a726 100644 (file)
--- 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;
 }