Skip to content

Commit 8686a36

Browse files
committedMay 16, 2023
8307315: Missing ResourceMark in CDS and JVMTI code
Reviewed-by: coleenp, iklam
1 parent 23cbb2d commit 8686a36

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed
 

‎src/hotspot/share/cds/filemap.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,7 @@ class FileMapInfo : public CHeapObj<mtInternal> {
487487
static void record_non_existent_class_path_entry(const char* path);
488488

489489
#if INCLUDE_JVMTI
490+
// Caller needs a ResourceMark because parts of the returned cfs are resource-allocated.
490491
static ClassFileStream* open_stream_for_jvmti(InstanceKlass* ik, Handle class_loader, TRAPS);
491492
#endif
492493

‎src/hotspot/share/classfile/klassFactory.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ InstanceKlass* KlassFactory::check_shared_class_file_load_hook(
5454
assert(ik != nullptr, "sanity");
5555
assert(ik->is_shared(), "expecting a shared class");
5656
if (JvmtiExport::should_post_class_file_load_hook()) {
57-
57+
ResourceMark rm(THREAD);
5858
// Post the CFLH
5959
JvmtiCachedClassFileData* cached_class_file = nullptr;
6060
if (cfs == nullptr) {

1 commit comments

Comments
 (1)

openjdk-notifier[bot] commented on May 16, 2023

@openjdk-notifier[bot]
Please sign in to comment.