From c0e05b3952fa7190116fdc1df124bc6fa5804027 Mon Sep 17 00:00:00 2001 From: weiyu Date: Wed, 31 Jul 2019 01:27:03 -0700 Subject: [PATCH 1/1] fix bug --- funcnode.cc | 12 +----------- history.cc | 7 ++++++- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/funcnode.cc b/funcnode.cc index 1e08f1c5..2b252546 100644 --- a/funcnode.cc +++ b/funcnode.cc @@ -124,17 +124,7 @@ void FuncNode::store_read(ModelAction * act, uint32_t tid) read_map->put(location, read_from_val); /* Store the memory locations where atomic reads happen */ - bool push_loc = true; - mllnode * it; - for (it = read_locations.begin();it != NULL;it=it->getNext()) { - if (location == it->getVal()) { - push_loc = false; - break; - } - } - - if (push_loc) - read_locations.push_back(location); + // read_locations.add(location); } uint64_t FuncNode::query_last_read(void * location, uint32_t tid) diff --git a/history.cc b/history.cc index 5af063e3..60bda965 100644 --- a/history.cc +++ b/history.cc @@ -29,7 +29,7 @@ void ModelHistory::enter_function(const uint32_t func_id, thread_id_t tid) if ( thrd_func_list->size() <= id ) { uint oldsize = thrd_func_list->size(); thrd_func_list->resize( id + 1 ); - for(uint i=oldsize;iresize( id + 1 ); @@ -94,6 +94,11 @@ void ModelHistory::resize_func_nodes(uint32_t new_size) void ModelHistory::process_action(ModelAction *act, thread_id_t tid) { + action_type act_type = act->get_type(); + if (act_type == THREAD_FINISH || act_type == THREAD_JOIN || + act_type == PTHREAD_JOIN || act_type == THREADONLY_FINISH) + return; + /* return if thread i has not entered any function or has exited from all functions */ SnapVector * thrd_func_list = model->get_execution()->get_thrd_func_list(); -- 2.34.1