8189766: whitebox failure with -Xcheck:jni
authordholmes
Tue, 29 May 2018 17:21:31 -0400
changeset 50299 896486c6e357
parent 50298 188a87cbfac3
child 50300 d11e87c8cd44
8189766: whitebox failure with -Xcheck:jni Reviewed-by: lfoltan, kbarrett
src/hotspot/share/prims/whitebox.cpp
--- a/src/hotspot/share/prims/whitebox.cpp	Tue May 29 16:02:23 2018 -0400
+++ b/src/hotspot/share/prims/whitebox.cpp	Tue May 29 17:21:31 2018 -0400
@@ -98,6 +98,7 @@
 #define CHECK_JNI_EXCEPTION_(env, value)                               \
   do {                                                                 \
     JavaThread* THREAD = JavaThread::thread_from_jni_environment(env); \
+    THREAD->clear_pending_jni_exception_check();                       \
     if (HAS_PENDING_EXCEPTION) {                                       \
       return(value);                                                   \
     }                                                                  \
@@ -106,6 +107,7 @@
 #define CHECK_JNI_EXCEPTION(env)                                       \
   do {                                                                 \
     JavaThread* THREAD = JavaThread::thread_from_jni_environment(env); \
+    THREAD->clear_pending_jni_exception_check();                       \
     if (HAS_PENDING_EXCEPTION) {                                       \
       return;                                                          \
     }                                                                  \