changeset 57763:05e57d7c7c6f lworld

8234246: [lworld] InterpreterRuntime::is_substitutable fails with guarantee(!HAS_PENDING_EXCEPTION) failed: isSubstitutable() raised exception Reviewed-by: mchung
author fparain
date Mon, 18 Nov 2019 15:57:50 -0500
parents 7e19dedbfb55
children f6f169af0f2c
files src/hotspot/share/interpreter/interpreterRuntime.cpp
diffstat 1 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/interpreter/interpreterRuntime.cpp	Fri Nov 15 09:38:34 2019 +0100
+++ b/src/hotspot/share/interpreter/interpreterRuntime.cpp	Mon Nov 18 15:57:50 2019 -0500
@@ -536,7 +536,16 @@
   args.push_oop(hb);
   methodHandle method(Universe::is_substitutable_method());
   JavaCalls::call(&result, method, &args, THREAD);
-  guarantee(!HAS_PENDING_EXCEPTION, "isSubstitutable() raised exception");
+  if (HAS_PENDING_EXCEPTION) {
+    // Something really bad happened because isSubstitutable() should not throw exceptions
+    // If it is an error, just let it propagate
+    // If it is an exception, wrap it into an InternalError
+    if (!PENDING_EXCEPTION->is_a(SystemDictionary::Error_klass())) {
+      Handle e(THREAD, PENDING_EXCEPTION);
+      CLEAR_PENDING_EXCEPTION;
+      THROW_MSG_CAUSE_(vmSymbols::java_lang_InternalError(), "Internal error in substitutability test", e, false);
+    }
+  }
   return result.get_jboolean();
 JRT_END