-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nested catch statements that span multiple basic blocks lead to invalid decompilations/exceptions #43
Comments
It seems like the exception handler's catch block gets duplicated in I printed the following internal structures:
And got the following output:
In the former, I think that the presence of
in the second try block is incorrect, and that in the latter, the presence of
in the second try block is incorrect. I suspect they're being included because they're within the bounds |
It seems like the call to
This would break other test cases though, so I'll still need to understand |
Oh lord, you've stumbled into Procyon's weakest link--it's exception handler processing. It's pretty broken, and I'm honestly surprised it works as well as it does (most of the time). It's really not hard to break it, especially if you're feeding it classes that weren't emitted by a Java compiler. I've promised myself I'll rewrite it at some point, but I've been telling myself that for years, so 🤷🏻♂️. |
I'd still like to fix this (this is a minimized reproducer for a larger program that fails to decompile some methods, with the same exception as Do you think it's likely that local fixes can work, or that a partial rewrite is needed? Current local fixes I'm considering:
|
The following classes (manually assembled by Krakatau) fail to decompile with the
develop
branch of Procyon.The former (
NestedCatchA
), decompiles to source code thatjavac
rejects due tothrow;
not providing an expression.The latter (
NestedCatchB
) causes the exception fromcom.strobel.decompiler.ast.Error.expressionLinkedFromMultipleLocations
to be thrown.I'd expect them to decompile to something similar to
NestedCatch{A,B}Expected
.I'd be interested in working on a fix, if you have suggestions for how to proceed.
The text was updated successfully, but these errors were encountered: