From: weiyu Date: Wed, 31 Jul 2019 20:24:55 +0000 (-0700) Subject: initialize memory location first X-Git-Url: http://plrg.eecs.uci.edu/git/?p=c11tester.git;a=commitdiff_plain;h=9f4ad85b11b8995690bb13097c5515bcd44f3a09 initialize memory location first --- diff --git a/history.cc b/history.cc index deaab0be..c1c9edf5 100644 --- a/history.cc +++ b/history.cc @@ -30,6 +30,7 @@ void ModelHistory::enter_function(const uint32_t func_id, thread_id_t tid) uint oldsize = thrd_func_list->size(); thrd_func_list->resize( id + 1 ); for (uint i = oldsize; i < id + 1; i++) { + new(&(*thrd_func_list)[i]) func_id_list_t(); // push 0 as a dummy function id to a void seg fault (*thrd_func_list)[i].push_back(0); }