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 7c0575f..fb492a5 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)
 {
 
 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;
 }
 
 /**
 }
 
 /**