From 9f4ad85b11b8995690bb13097c5515bcd44f3a09 Mon Sep 17 00:00:00 2001 From: weiyu Date: Wed, 31 Jul 2019 13:24:55 -0700 Subject: [PATCH] initialize memory location first --- history.cc | 1 + 1 file changed, 1 insertion(+) 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); } -- 2.34.1