Relates :
|
|
Relates :
|
|
Relates :
|
A longstanding bug (6306530) recently came to light in which a GrowableArray was being allocated with the "C_heap" argument set to true but the GrowableArray itself (a ResourceObj) was being allocated without the ResourceObj::C_HEAP flag passed to operator new. This caused the GrowableArray object (containing the nesting, arena and data pointers) to be accidentally destroyed and overwritten. While in some cases it is not incorrect to allocate a GrowableArray in this fashion (for example, when the initial allocation is performed at a well-known ResourceMark nesting but modifications to it will not be), in general this is problematic usage and should be disallowed. In debug mode, ResourceObj and NonPrintingResourceObj should record whether they were allocated from the C heap, and the GrowableArray constructor should assert that if the C_heap argument is true, that the GrowableArray itself was allocated from the C heap. - - - - - -
|