sky201503 / dex2jar

Automatically exported from code.google.com/p/dex2jar
0 stars 0 forks source link

Dex reports error when trying to translate accesses to array references initialised to null. #122

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Write the following java snippet:

    int[]a = null;
    int b = a[1];

2. Compile to dex. Dex is:

    const/4 v0, 0x0
    const/4 v2, 0x1
    aget v1, v0, v2

3. Try to convert it to jar using dex2jar.

What is the expected output? What do you see instead?

Dex2Jar reports an error and produces the following: Error file is attached.

Code:
   Stack=3, Locals=2, Args_size=2
   0:   new #14; //class java/lang/RuntimeException
   3:   dup
   4:   ldc #16; //String Generated by Dex2jar, and Some Exception Caught :java.lang.NullPointerException\n\tat com.googlecode.dex2jar.v3.IrMethod2AsmMethod$2.exec(IrMethod2AsmMethod.java:338)\n\tat com.googlecode.dex2jar.ir.ts.Cfg.Forward(Cfg.java:270)\n\tat com.googlecode.dex2jar.v3.IrMethod2AsmMethod.reIndexLocalDirect(IrMethod2AsmMethod.java:314)\n\tat com.googlecode.dex2jar.v3.IrMethod2AsmMethod.reIndexLocal(IrMethod2AsmMethod.java:294)\n\tat com.googlecode.dex2jar.v3.IrMethod2AsmMethod.convert(IrMethod2AsmMethod.java:352)\n\tat com.googlecode.dex2jar.v3.V3MethodAdapter.visitEnd(V3MethodAdapter.java:228)\n\tat com.googlecode.dex2jar.v3.V3ClassAdapter$2.visitEnd(V3ClassAdapter.java:264)\n\tat com.googlecode.dex2jar.reader.DexFileReader.acceptMethod(DexFileReader.java:702)\n\tat com.googlecode.dex2jar.reader.DexFileReader.acceptClass(DexFileReader.java:451)\n\tat com.googlecode.dex2jar.reader.DexFileReader.accept(DexFileReader.java:333)\n\tat com.googlecode.dex2jar.v3.Dex2jar.doTranslate(Dex2jar.java:82)\n\tat com.googlecode.dex2jar.v3.Dex2jar.to(Dex2jar.java:219)\n\tat com.googlecode.dex2jar.v3.Dex2jar.to(Dex2jar.java:210)\n\tat com.googlecode.dex2jar.tools.Dex2jarCmd.doCommandLine(Dex2jarCmd.java:108)\n\tat com.googlecode.dex2jar.tools.BaseCmd.doMain(BaseCmd.java:118)\n\tat com.googlecode.dex2jar.tools.Dex2jarCmd.main(Dex2jarCmd.java:34)\n
   6:   invokespecial   #19; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
   9:   athrow

What version of the product are you using? On what operating system?

Latest build from 0.0.9.x branch.

Original issue reported on code.google.com by O.Tsapo...@gmail.com on 12 Jun 2012 at 6:21

Attachments: