8215495: Set isCopy to JNI_FALSE if len == 0
Summary: Set isCopy in a corner case
Reviewed-by: dholmes, phh, minqi
--- 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. */ \