8150850: [JVMCI] NPE when executing HotSpotConstantReflectionProvider.readStableFieldValue
authorkshefov
Tue, 15 Mar 2016 13:00:43 +0300
changeset 36606 8167f548e63c
parent 36605 59b58343d358
child 36609 94f0720927a0
8150850: [JVMCI] NPE when executing HotSpotConstantReflectionProvider.readStableFieldValue Reviewed-by: twisti, dnsimon
hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java
--- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java	Mon Mar 14 17:51:25 2016 +0100
+++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java	Tue Mar 15 13:00:43 2016 +0300
@@ -339,7 +339,7 @@
 
     public JavaConstant readStableFieldValue(ResolvedJavaField field, JavaConstant receiver, boolean isDefaultStable) {
         JavaConstant fieldValue = readNonStableFieldValue(field, receiver);
-        if (fieldValue.isNonNull()) {
+        if (fieldValue != null && fieldValue.isNonNull()) {
             JavaType declaredType = field.getType();
             if (declaredType.getComponentType() != null) {
                 int stableDimension = getArrayDimension(declaredType);