From 21cf6d1f636ab509084e41fb0511c1f9faaff04f Mon Sep 17 00:00:00 2001 From: Min Choi Date: Tue, 30 Jan 2024 23:56:04 +0000 Subject: [PATCH] Backport 7d1a48807a482cd19156298ce21d9492f0d912da --- src/hotspot/share/utilities/exceptions.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/hotspot/share/utilities/exceptions.cpp b/src/hotspot/share/utilities/exceptions.cpp index 98be313be44..745dca08a58 100644 --- a/src/hotspot/share/utilities/exceptions.cpp +++ b/src/hotspot/share/utilities/exceptions.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -415,6 +415,7 @@ void Exceptions::wrap_dynamic_exception(Thread* THREAD) { // Pass through an Error, including BootstrapMethodError, any other form // of linkage error, or say ThreadDeath/OutOfMemoryError if (TraceMethodHandles) { + ResourceMark rm(THREAD); tty->print_cr("[constant/invoke]dynamic passes through an Error for " INTPTR_FORMAT, p2i((void *)exception)); exception->print(); } @@ -423,6 +424,7 @@ void Exceptions::wrap_dynamic_exception(Thread* THREAD) { // Otherwise wrap the exception in a BootstrapMethodError if (TraceMethodHandles) { + ResourceMark rm(THREAD); tty->print_cr("[constant/invoke]dynamic throws BSME for " INTPTR_FORMAT, p2i((void *)exception)); exception->print(); }