8321685: Missing ResourceMark in code called from JvmtiEnvBase::get_vthread_jvf

Reviewed-by: amenkov, cjplummer
This commit is contained in:
Serguei Spitsyn 2024-01-10 14:07:57 +00:00
parent ec38505720
commit 2806adee2d

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2024, 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
@ -2407,6 +2407,7 @@ UpdateForPopTopFrameClosure::doit(Thread *target, bool self) {
void
SetFramePopClosure::do_thread(Thread *target) {
Thread* current = Thread::current();
ResourceMark rm(current); // vframes are resource allocated
JavaThread* java_thread = JavaThread::cast(target);
if (java_thread->is_exiting()) {
@ -2433,6 +2434,9 @@ SetFramePopClosure::do_thread(Thread *target) {
void
SetFramePopClosure::do_vthread(Handle target_h) {
Thread* current = Thread::current();
ResourceMark rm(current); // vframes are resource allocated
if (!_self && !JvmtiVTSuspender::is_vthread_suspended(target_h())) {
_result = JVMTI_ERROR_THREAD_NOT_SUSPENDED;
return;