From 4cda0b365dcd54cada23c4782bdb113ed2608cc7 Mon Sep 17 00:00:00 2001 From: Panxiaobo Date: Mon, 11 Jun 2012 11:03:44 +0800 Subject: [PATCH] type array reference as Object in local type. Fixes issue 120 --HG-- branch : 0.0.9.x --- .../src/main/java/com/googlecode/dex2jar/ir/ts/LocalType.java | 1 + .../src/test/java/com/googlecode/dex2jar/test/I120Test.java | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/LocalType.java b/dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/LocalType.java index 95f1ce2e..e5b4b072 100644 --- a/dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/LocalType.java +++ b/dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/LocalType.java @@ -172,6 +172,7 @@ public class LocalType implements Transformer { case LENGTH: { UnopExpr te = (UnopExpr) v; exec(te.op.value); + type(te.op.value, Type.getType(Object.class)); type(tb, Type.INT_TYPE); } break; diff --git a/dex-translator/src/test/java/com/googlecode/dex2jar/test/I120Test.java b/dex-translator/src/test/java/com/googlecode/dex2jar/test/I120Test.java index abe0cb5d..0cd27650 100644 --- a/dex-translator/src/test/java/com/googlecode/dex2jar/test/I120Test.java +++ b/dex-translator/src/test/java/com/googlecode/dex2jar/test/I120Test.java @@ -22,10 +22,10 @@ public class I120Test { DexMethodVisitor mv = cv.visitMethod(ACC_PUBLIC | ACC_STATIC, new Method("La;", "b", new String[] {}, "V")); DexCodeVisitor code = mv.visitCode(); code.visitArguments(3, new int[] {}); - code.visitConstStmt(OP_CONST, 0, Integer.valueOf(0), TYPE_SINGLE); // int: 0xffffffff float:NaN + code.visitConstStmt(OP_CONST, 0, Integer.valueOf(0), TYPE_SINGLE); code.visitMethodStmt(OP_INVOKE_VIRTUAL, new int[] { 0 }, new Method("Ljava/lang/String;", "toString", new String[] {}, "Ljava/lang/String;")); - code.visitConstStmt(OP_CONST, 1, Integer.valueOf(0), TYPE_SINGLE); // int: 0xffffffff float:NaN + code.visitConstStmt(OP_CONST, 1, Integer.valueOf(0), TYPE_SINGLE); code.visitUnopStmt(OP_ARRAY_LENGTH, 2, 1, TYPE_INT); code.visitReturnStmt(OP_RETURN_VOID); code.visitEnd();