From fff0a7571d2fc4b9c3186ae2c7f844c22dac3b2b Mon Sep 17 00:00:00 2001 From: Brian Demsky Date: Wed, 19 Sep 2012 00:25:45 -0700 Subject: [PATCH] fix bug --- model.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/model.cc b/model.cc index 7c0575f..fb492a5 100644 --- a/model.cc +++ b/model.cc @@ -1079,10 +1079,11 @@ void ModelChecker::add_action_to_lists(ModelAction *act) ModelAction * ModelChecker::get_last_action(thread_id_t tid) { - int nthreads = get_num_threads(); - if ((int)thrd_last_action->size() < nthreads) - thrd_last_action->resize(nthreads); - return (*thrd_last_action)[id_to_int(tid)]; + int threadid=id_to_int(tid); + if (threadid<(int)thrd_last_action->size()) + return (*thrd_last_action)[id_to_int(tid)]; + else + return NULL; } /** -- 2.34.1