8215495: Set isCopy to JNI_FALSE if len == 0
authorjcbeyler
Tue, 08 Jan 2019 09:55:55 -0800
changeset 53197 c92f4465fff1
parent 53196 48d09a9f4d2b
child 53198 8663bd437bb8
8215495: Set isCopy to JNI_FALSE if len == 0 Summary: Set isCopy in a corner case Reviewed-by: dholmes, phh, minqi
src/hotspot/share/prims/jni.cpp
--- a/src/hotspot/share/prims/jni.cpp	Tue Jan 08 10:29:02 2019 -0500
+++ b/src/hotspot/share/prims/jni.cpp	Tue Jan 08 09:55:55 2019 -0800
@@ -2709,6 +2709,9 @@
   ElementType* result; \
   int len = a->length(); \
   if (len == 0) { \
+    if (isCopy != NULL) { \
+      *isCopy = JNI_FALSE; \
+    } \
     /* Empty array: legal but useless, can't return NULL. \
      * Return a pointer to something useless. \
      * Avoid asserts in typeArrayOop. */ \