From: Brian Demsky Date: Wed, 19 Sep 2012 07:25:45 +0000 (-0700) Subject: fix bug X-Git-Tag: pldi2013~184 X-Git-Url: http://plrg.eecs.uci.edu/git/?p=model-checker.git;a=commitdiff_plain;h=fff0a7571d2fc4b9c3186ae2c7f844c22dac3b2b;ds=sidebyside fix bug --- 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; } /**