Storyyeller / Krakatau

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

KeyError on back-to-back try/catches #69

Closed samczsun closed 8 years ago

samczsun commented 8 years ago
.version 52 0 
.class public super Test 
.super java/lang/Object 

.method public <init> : ()V 
    .code stack 1 locals 1 
L0:     aload_0 
L1:     invokespecial Method java/lang/Object <init> ()V 
L4:     return 
    .end code 
.end method 

.method public static main : ([Ljava/lang/String;)V 
    .code stack 10 locals 10 
        .catch java/lang/Throwable from Ls1 to Le1 using Ls1
        .catch java/lang/Throwable from Ls2 to Le2 using Ls2
        aconst_null
        .stack full
            locals
            stack Object java/lang/Object
        .end stack
Ls1:    nop
Le1:    return
        .stack full
            locals
            stack Object java/lang/Object
        .end stack
Ls2:    nop
Le2:    return
    .end code 
.end method 
.end class 

Get rid of one copy and it decompiles fine

EDIT: Simplified it a bit. Might be easier for you to tell what's causing it now

Storyyeller commented 8 years ago

I was beginning to wonder if something had happened to you with the lack of bug reports yesterday. :P

I'm surprised the whole thing doesn't just optimize away, since there's no throwing instructions (except the return, which isn't in an exception block). I'll have to look into it later.

Storyyeller commented 8 years ago

Should be fixed now.