Storyyeller / Krakatau

Java decompiler, assembler, and disassembler
GNU General Public License v3.0
1.95k stars 220 forks source link

AssertionError in cfg #72

Closed samczsun closed 8 years ago

samczsun commented 8 years ago
.method public static main : ([Ljava/lang/String;)V 
    .code stack 10 locals 10
        .catch java/lang/Throwable from L0 to L1 using L0
        new java/lang/Integer
        astore_1
        iconst_0
        istore_2
        aconst_null
        .stack full
            locals Object [Ljava/lang/String; Uninitialized Linit Integer
            stack Object java/lang/Object
        .end stack
L0:     
        pop
        iload_2
        ifne L3
        aload_1
        astore_1
        iconst_1
        istore_2
        aconst_null
        athrow
L1:
        return   
        .stack full
            locals Object [Ljava/lang/String; Uninitialized Linit Integer
            stack
        .end stack     
L3:
        aload_1
        dup
        iconst_0
        invokespecial Method java/lang/Integer <init> (I)V
        getstatic java/lang/System out Ljava/io/PrintStream;
        swap
        invokevirtual java/io/PrintStream println (Ljava/lang/Object;)V
        return
    .end code 
.end method
Storyyeller commented 8 years ago

You accidentally left out the Linit label. I assume it was meant to be at the beginning?

Storyyeller commented 8 years ago

Should be fixed now. Note that the issue is in an ugly and error prone part of the code, so there might be other similar issues. A proper solution will have to wait until I get around to rewriting the code in question, which isn't going to happen in the forseeable future.

By the way, are you ok with me using your repro examples as test cases? (i.e. do you agree to license them under GPLv3)

samczsun commented 8 years ago

I'm fine with licensing it under GPLv3, but if Krakatau ever decides to migrate to Apache 2.0 I'll be happy to relicense :P