hotspot/src/share/vm/ci/ciArray.cpp
changeset 36330 37a0f096251b
parent 29081 c61eb4914428
child 46630 75aa3e39d02c
--- a/hotspot/src/share/vm/ci/ciArray.cpp	Wed Feb 24 09:22:45 2016 -0800
+++ b/hotspot/src/share/vm/ci/ciArray.cpp	Fri Feb 26 01:58:26 2016 +0300
@@ -107,8 +107,9 @@
   intptr_t header = arrayOopDesc::base_offset_in_bytes(elembt);
   intptr_t index = (element_offset - header) >> shift;
   intptr_t offset = header + ((intptr_t)index << shift);
-  if (offset != element_offset || index != (jint)index)
+  if (offset != element_offset || index != (jint)index || index < 0 || index >= length()) {
     return ciConstant();
+  }
   return element_value((jint) index);
 }