--- 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);
}