From 2c834425c98ad18bb10d01ee7263f13d8948f13d Mon Sep 17 00:00:00 2001 From: chiba Date: Mon, 16 May 2005 15:59:01 +0000 Subject: [PATCH] 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 --- src/main/javassist/compiler/CodeGen.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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, -- 2.39.5