diff src/share/vm/opto/doCall.cpp @ 13522:ad3c9d35ee12

8185736: missing default exception handler in calls to rethrow_Stub Reviewed-by: kvn
author never
date Tue, 15 Aug 2017 17:18:00 +0000
parents b4438b96a1db
children 958228979fe8
line wrap: on
line diff
--- a/src/share/vm/opto/doCall.cpp	Tue Aug 15 14:03:52 2017 +0000
+++ b/src/share/vm/opto/doCall.cpp	Tue Aug 15 17:18:00 2017 +0000
@@ -719,6 +719,7 @@
   GrowableArray<const Type*>* extypes = new (C->node_arena()) GrowableArray<const Type*>(C->node_arena(), 8, 0, NULL);
   GrowableArray<int>* saw_unloaded = new (C->node_arena()) GrowableArray<int>(C->node_arena(), 8, 0, 0);
 
+  bool default_handler = false;
   for (; !handlers.is_done(); handlers.next()) {
     ciExceptionHandler* h        = handlers.handler();
     int                 h_bci    = h->handler_bci();
@@ -741,6 +742,14 @@
     // Note:  It's OK if the BCIs repeat themselves.
     bcis->append(h_bci);
     extypes->append(h_extype);
+    if (h_bci == -1) {
+      default_handler = true;
+    }
+  }
+
+  if (!default_handler) {
+    bcis->append(-1);
+    extypes->append(TypeOopPtr::make_from_klass(env()->Throwable_klass())->is_instptr());
   }
 
   int len = bcis->length();