8307315: Missing ResourceMark in CDS and JVMTI code

Reviewed-by: coleenp, iklam
This commit is contained in:
Calvin Cheung 2023-05-16 14:42:33 +00:00
parent 23cbb2d170
commit 8686a36b40
2 changed files with 2 additions and 1 deletions

View File

@ -487,6 +487,7 @@ public:
static void record_non_existent_class_path_entry(const char* path);
#if INCLUDE_JVMTI
// Caller needs a ResourceMark because parts of the returned cfs are resource-allocated.
static ClassFileStream* open_stream_for_jvmti(InstanceKlass* ik, Handle class_loader, TRAPS);
#endif

View File

@ -54,7 +54,7 @@ InstanceKlass* KlassFactory::check_shared_class_file_load_hook(
assert(ik != nullptr, "sanity");
assert(ik->is_shared(), "expecting a shared class");
if (JvmtiExport::should_post_class_file_load_hook()) {
ResourceMark rm(THREAD);
// Post the CFLH
JvmtiCachedClassFileData* cached_class_file = nullptr;
if (cfs == nullptr) {