@@ -239,8 +239,10 @@ void JVMCIEnv::check_init(JVMCI_TRAPS) {
239239 if (_init_error == JNI_ENOMEM) {
240240 JVMCI_THROW_MSG (OutOfMemoryError, " JNI_ENOMEM creating or attaching to libjvmci" );
241241 }
242- JVMCI_THROW_MSG (InternalError, err_msg (" Error creating or attaching to libjvmci (err: %d, description: %s)" ,
243- _init_error, _init_error_msg == nullptr ? " unknown" : _init_error_msg));
242+ stringStream st;
243+ st.print (" Error creating or attaching to libjvmci (err: %d, description: %s)" ,
244+ _init_error, _init_error_msg == nullptr ? " unknown" : _init_error_msg);
245+ JVMCI_THROW_MSG (InternalError, st.freeze ());
244246}
245247
246248void JVMCIEnv::check_init (TRAPS) {
@@ -250,8 +252,10 @@ void JVMCIEnv::check_init(TRAPS) {
250252 if (_init_error == JNI_ENOMEM) {
251253 THROW_MSG (vmSymbols::java_lang_OutOfMemoryError (), " JNI_ENOMEM creating or attaching to libjvmci" );
252254 }
253- THROW_MSG (vmSymbols::java_lang_OutOfMemoryError (), err_msg (" Error creating or attaching to libjvmci (err: %d, description: %s)" ,
254- _init_error, _init_error_msg == nullptr ? " unknown" : _init_error_msg));
255+ stringStream st;
256+ st.print (" Error creating or attaching to libjvmci (err: %d, description: %s)" ,
257+ _init_error, _init_error_msg == nullptr ? " unknown" : _init_error_msg);
258+ THROW_MSG (vmSymbols::java_lang_OutOfMemoryError (), st.freeze ());
255259}
256260
257261// Prints a pending exception (if any) and its stack trace to st.
0 commit comments