changeset 9835:fcfedd3dd2eb

ResolvedJavaType.isAssignableFrom must not be called with null argument. Check that with assertions in HotSpot implementation.
author Christian Wimmer <christian.wimmer@oracle.com>
date Tue, 28 May 2013 16:15:36 -0700
parents df223ca2d6af
children eed6a2a93920
files graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedObjectType.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedPrimitiveType.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/StoreIndexedNode.java
diffstat 3 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedObjectType.java	Tue May 28 16:13:15 2013 -0700
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedObjectType.java	Tue May 28 16:15:36 2013 -0700
@@ -313,6 +313,7 @@
 
     @Override
     public boolean isAssignableFrom(ResolvedJavaType other) {
+        assert other != null;
         if (other instanceof HotSpotResolvedObjectType) {
             HotSpotResolvedObjectType otherType = (HotSpotResolvedObjectType) other;
             return javaMirror.isAssignableFrom(otherType.javaMirror);
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedPrimitiveType.java	Tue May 28 16:13:15 2013 -0700
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedPrimitiveType.java	Tue May 28 16:15:36 2013 -0700
@@ -129,6 +129,7 @@
 
     @Override
     public boolean isAssignableFrom(ResolvedJavaType other) {
+        assert other != null;
         return other == this;
     }
 
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/StoreIndexedNode.java	Tue May 28 16:13:15 2013 -0700
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/StoreIndexedNode.java	Tue May 28 16:15:36 2013 -0700
@@ -74,7 +74,7 @@
             int index = indexValue.isConstant() ? indexValue.asConstant().asInt() : -1;
             if (index >= 0 && index < arrayState.getVirtualObject().entryCount()) {
                 ResolvedJavaType componentType = arrayState.getVirtualObject().type().getComponentType();
-                if (componentType.isPrimitive() || value.objectStamp().alwaysNull() || componentType.isAssignableFrom(value.objectStamp().type())) {
+                if (componentType.isPrimitive() || value.objectStamp().alwaysNull() || (value.objectStamp().type() != null && componentType.isAssignableFrom(value.objectStamp().type()))) {
                     tool.setVirtualEntry(arrayState, index, value());
                     tool.delete();
                 }