diff options
author | chiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3> | 2005-05-16 15:59:01 +0000 |
---|---|---|
committer | chiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3> | 2005-05-16 15:59:01 +0000 |
commit | 2c834425c98ad18bb10d01ee7263f13d8948f13d (patch) | |
tree | 651887645d501dc8a1b3d9f325bb5394c0351113 /src | |
parent | 5b7f8857037a9fd931ef1d6171fee6e7f2f0ec2e (diff) | |
download | javassist-2c834425c98ad18bb10d01ee7263f13d8948f13d.tar.gz javassist-2c834425c98ad18bb10d01ee7263f13d8948f13d.zip |
fixed a bug so that "<array> == null" can be compiled.
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@171 30ef5769-5b8d-40dd-aea6-55b5d6557bb3
Diffstat (limited to 'src')
-rw-r--r-- | src/main/javassist/compiler/CodeGen.java | 7 |
1 files 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, |