diff --git a/vvp/codes.cc b/vvp/codes.cc index 52ed21e80..bb8bc8b27 100644 --- a/vvp/codes.cc +++ b/vvp/codes.cc @@ -46,8 +46,7 @@ static unsigned current_within_chunk = 0; void codespace_init(void) { assert(current_chunk == 0); - /* Value-initialize so unused slots are not random (opcode NULL). */ - first_chunk = new struct vvp_code_s [code_chunk_size](); + first_chunk = new struct vvp_code_s [code_chunk_size]; current_chunk = first_chunk; current_chunk[0].opcode = &of_ZOMBIE; @@ -65,7 +64,7 @@ vvp_code_t codespace_next(void) { if (current_within_chunk == (code_chunk_size-1)) { current_chunk[code_chunk_size-1].cptr - = new struct vvp_code_s [code_chunk_size](); + = new struct vvp_code_s [code_chunk_size]; current_chunk = current_chunk[code_chunk_size-1].cptr; /* Put a link opcode on the end of the chunk. */ diff --git a/vvp/vthread.cc b/vvp/vthread.cc index aefde9e02..8170c2d17 100644 --- a/vvp/vthread.cc +++ b/vvp/vthread.cc @@ -770,15 +770,9 @@ vthread_t vthread_new(vvp_code_t pc, __vpiScope*scope) thr->flags[1] = BIT4_1; thr->flags[2] = BIT4_X; thr->flags[3] = BIT4_Z; - /* Initialize the remaining flags. Older code only cleared 4..7; the - codegen freely uses higher flag indices, so leave nothing - uninitialized for tools like valgrind. */ - for (int idx = 4 ; idx < vthread_s::FLAGS_COUNT ; idx += 1) + for (int idx = 4 ; idx < 8 ; idx += 1) thr->flags[idx] = BIT4_X; - for (int idx = 0 ; idx < vthread_s::WORDS_COUNT ; idx += 1) - thr->words[idx].w_uint = 0; - scope->threads .insert(thr); return thr; }