diff options
Diffstat (limited to 'src/main/javassist/compiler')
-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, |