]> source.dussan.org Git - javassist.git/commitdiff
fixed a bug so that "<array> == null" can be compiled.
authorchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>
Mon, 16 May 2005 15:59:01 +0000 (15:59 +0000)
committerchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>
Mon, 16 May 2005 15:59:01 +0000 (15:59 +0000)
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@171 30ef5769-5b8d-40dd-aea6-55b5d6557bb3

src/main/javassist/compiler/CodeGen.java

index 3e7ae47cf1ca314617219a0aa52b3cccf6d8ffe9..5ddbc3baa8ef47c3ce5081c4b1e56c2aa0e342ae 100644 (file)
@@ -1143,10 +1143,13 @@ public abstract class CodeGen extends Visitor implements Opcode, TokenId {
         int type1 = exprType;
         int dim1 = arrayDim;
         expr.oprand2().accept(this);
-        if (dim1 != arrayDim)
+        if (dim1 != arrayDim && type1 != NULL && exprType != NULL)
             throw new CompileError("incompatible array types");
 
-        return type1;
+        if (type1 == NULL)
+            return exprType;
+        else
+            return type1;
     }
 
     private static final int ifOp[] = { EQ, IF_ICMPEQ, IF_ICMPNE,