Skip to content
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

[core] Failed to decompile try-catch-finally - Try blocks wrapping queue limit reached #1304

Closed
nitram84 opened this issue Dec 11, 2021 · 3 comments
Labels
bug Core Issues in jadx-core module

Comments

@nitram84
Copy link
Contributor

Decompiling this sample fails with an error in BlockProcessor pass: "Try blocks wrapping queue limit reached".

I tested with latest git revision 0f00fb9 and openjdk8. Same result with java-input and java-convert.

public class TestTryCatch1 {

  public void doSomething(int i) {
    try {
      doSomething1();

      if (i == -12) {
        return;
      }
      
      if (i > 10) {
        doSomething2();
      } else if (i == -1) {
        doSomething3();
      }
    } catch (Exception ex) {
      logError();
    } finally {
      doSomething4();
    }
  }

  private void logError() {
  }

  private void doSomething1() {
  }

  private void doSomething2() {
  }

  private void doSomething3() {
  }

  private void doSomething4() {
  }
}

This sample can be used in unit tests.

@nitram84 nitram84 added bug Core Issues in jadx-core module labels Dec 11, 2021
@skylot
Copy link
Owner

skylot commented Dec 13, 2021

@nitram84 fixed, although it is not general enough so may break something else 🥲

@skylot skylot closed this as completed Dec 13, 2021
@nitram84
Copy link
Contributor Author

@skylot Thank you a lot for fixing this issue. Usually my examples are taken from real code. I minimized the code to the root and obfuscated it - every change to my example makes it decompilable. Think of a complex method with 100 or 200 lines that can now be decompiled by this fix. I think the best way to break large apps with large methods is to report and fix all the smaller problems.

@skylot
Copy link
Owner

skylot commented Dec 14, 2021

I think the best way to break large apps with large methods is to report and fix all the smaller problems.

You are right and this is the only way! Thank you for your work 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Core Issues in jadx-core module
Projects
None yet
Development

No branches or pull requests

2 participants