8234691: Potential double-free in ParallelSPCleanupTask constructor

Prevent extraneous constructor call

Reviewed-by: dholmes, stefank
This commit is contained in:
David Buck 2020-04-21 19:52:18 -04:00
parent d041941e64
commit f8f698465d
2 changed files with 4 additions and 2 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -324,6 +324,8 @@ class SubTasksDone: public CHeapObj<mtInternal> {
// Set all tasks to unclaimed.
void clear();
NONCOPYABLE(SubTasksDone);
public:
// Initializes "this" to a state in which there are "n" tasks to be
// processed, none of the which are originally claimed. The number of

View File

@ -532,7 +532,7 @@ private:
public:
ParallelSPCleanupTask(uint num_workers, DeflateMonitorCounters* counters) :
AbstractGangTask("Parallel Safepoint Cleanup"),
_subtasks(SubTasksDone(SafepointSynchronize::SAFEPOINT_CLEANUP_NUM_TASKS)),
_subtasks(SafepointSynchronize::SAFEPOINT_CLEANUP_NUM_TASKS),
_cleanup_threads_cl(ParallelSPCleanupThreadClosure(counters)),
_num_workers(num_workers),
_counters(counters) {}