changeset 53197:c92f4465fff1

8215495: Set isCopy to JNI_FALSE if len == 0 Summary: Set isCopy in a corner case Reviewed-by: dholmes, phh, minqi
author jcbeyler
date Tue, 08 Jan 2019 09:55:55 -0800
parents 48d09a9f4d2b
children 8663bd437bb8
files src/hotspot/share/prims/jni.cpp
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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. */ \