# HG changeset patch # User Doug Simon # Date 1491054334 -7200 # Node ID df038ccc5943254ce8f48c9f34ebbf33da026907 # Parent 244adb543e3641bda3db6a2abf7c705fedd33776 missing checks in HotSpotMemoryAccessProviderImpl can cause VM assertions to fail - part 6 (JDK-8177673) diff -r 244adb543e36 -r df038ccc5943 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 12:37:10 2017 +0200 +++ b/jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMemoryAccessProviderImpl.java Sat Apr 01 15:45:34 2017 +0200 @@ -62,10 +62,9 @@ HotSpotResolvedObjectType type = constant.getType(); Object object = constant.object(); if (object instanceof Class && kind != JavaKind.Object) { - // Cannot check bounds when reading from a java.lang.Class as - // we don't have the bounds for the variable length part of - // the object tail containing the static fields of the - // represented class. + // Cannot check bounds when reading primitives from java.lang.Class as + // we don't have the bounds for the part of a java.lang.Class object + // containing the static fields of the represented class. } else { checkRead(runtime, kind, displacement, type, object); } @@ -126,6 +125,9 @@ if (displacement == runtime.getConfig().classMirrorOffset) { // Klass::_java_mirror is valid for all Klass* values return true; + } else if (displacement == runtime.getConfig().arrayKlassComponentMirrorOffset) { + // ArrayKlass::_component_mirror is only valid for all ArrayKlass* values + return ((HotSpotResolvedObjectTypeImpl) metaspaceObject).mirror().isArray(); } } else { throw new IllegalArgumentException(String.valueOf(metaspaceObject));