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

Decompiler produces an (illegal) switch expression where it doesn't makes sense #161

Closed
Kroppeb opened this issue May 28, 2022 · 3 comments
Labels
bug Something isn't working Priority: High High priority Subsystem: Statement Structure Anything concerning how statements are structured in a method

Comments

@Kroppeb
Copy link
Contributor

Kroppeb commented May 28, 2022

Source

  public void test(Object a) {
    switch (10000) {
      default: {
        Object vvv26 = null;
        while (vvv26 == null) {
        }
      }
      case -79:
        long vvv36 = -5851592879203823622L;
      case 320:
        if (a != null) {
          return;
        }
    }
    System.out.println("Hi");
  }

Result:

   public void test(Object a) {
     long var4 = switch(10000) {
        case 320 -> {
        }
        default -> {
           Object vvv26 = null;

           while(vvv26 == null) {
           }
        }
        case -79 -> -5851592879203823622L;
     };
     if (a == null) {
        System.out.println("Hi");
     }
  }
@Kroppeb Kroppeb added the bug Something isn't working label May 28, 2022
@jaskarth jaskarth added Subsystem: Statement Structure Anything concerning how statements are structured in a method Priority: High High priority labels May 28, 2022
Kroppeb added a commit that referenced this issue May 28, 2022
@jaskarth
Copy link
Member

@Kroppeb
Copy link
Contributor Author

Kroppeb commented May 28, 2022

@jaskarth
Copy link
Member

Should be fixed by e37b6c7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Priority: High High priority Subsystem: Statement Structure Anything concerning how statements are structured in a method
Projects
None yet
Development

No branches or pull requests

2 participants