fix bug
authorBrian Demsky <bdemsky@uci.edu>
Wed, 19 Sep 2012 07:25:45 +0000 (00:25 -0700)
committerBrian Demsky <bdemsky@uci.edu>
Wed, 19 Sep 2012 07:25:45 +0000 (00:25 -0700)
model.cc

index 7c0575fe198f055f38849889df7c38b10cdc46f2..fb492a5363d1cfea467d3a8ef1438c812fd11e83 100644 (file)
--- 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;
 }
 
 /**