# HG changeset patch # User Doug Simon # Date 1491000820 -7200 # Node ID 2b760c6b056147ec39c0168f7a2dd7869d63f7b2 # Parent 8cf4cf3f9f2a7021072b7cc34fdb9d06b11be41f missing checks in HotSpotMemoryAccessProviderImpl can cause VM assertions to fail - part 4 (JDK-8177673) diff -r 8cf4cf3f9f2a -r 2b760c6b0561 jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMemoryAccessProviderImpl.java --- a/jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMemoryAccessProviderImpl.java Sat Apr 01 00:28:33 2017 +0200 +++ b/jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMemoryAccessProviderImpl.java Sat Apr 01 00:53:40 2017 +0200 @@ -84,7 +84,7 @@ int length = Array.getLength(object); long arrayEnd = headerSize + (sizeOfElement * length); boolean aligned = ((displacement - headerSize) % sizeOfElement) == 0; - if (displacement >= (arrayEnd - sizeOfElement) || (kind == JavaKind.Object && !aligned)) { + if (displacement > (arrayEnd - sizeOfElement) || (kind == JavaKind.Object && !aligned)) { int index = (int) ((displacement - headerSize) / sizeOfElement); throw new AssertionError("Unsafe array access: reading element of kind " + kind + " at offset " + displacement + " (index ~ " + index + ") in " +