From: chiba Date: Mon, 16 May 2005 15:59:01 +0000 (+0000) Subject: fixed a bug so that " == null" can be compiled. X-Git-Tag: rel_3_17_1_ga~450 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2c834425c98ad18bb10d01ee7263f13d8948f13d;p=javassist.git fixed a bug so that " == null" can be compiled. git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@171 30ef5769-5b8d-40dd-aea6-55b5d6557bb3 --- diff --git a/src/main/javassist/compiler/CodeGen.java b/src/main/javassist/compiler/CodeGen.java index 3e7ae47c..5ddbc3ba 100644 --- a/src/main/javassist/compiler/CodeGen.java +++ b/src/main/javassist/compiler/CodeGen.java @@ -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,