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

Unable to simplify switch on enum from BinExport2Reader.class #403

Open
rohitab opened this issue Jun 8, 2024 · 1 comment
Open

Unable to simplify switch on enum from BinExport2Reader.class #403

rohitab opened this issue Jun 8, 2024 · 1 comment
Labels
needs-info Further information from the issue author is needed Priority: Low Low priority Subsystem: Statement Structure Anything concerning how statements are structured in a method Type: Bug Something isn't working

Comments

@rohitab
Copy link

rohitab commented Jun 8, 2024

Vineflower version

1.10.1

Describe the bug

Here is the relevant section from the decompiled version of BinExport2Reader.class. Please see the comment tagged $VF.

// $VF: Unable to simplify switch on enum
// Please report this to the Vineflower issue tracker, at https://github.com/Vineflower/vineflower/issues with a copy of the class file (if you have the rights to distribute it!)
private static EJumpType toJumpType(com.google.security.zynamics.BinExport.BinExport2.FlowGraph.Edge.Type var0) {
  switch (1.$SwitchMap$com$google$security$zynamics$BinExport$BinExport2$FlowGraph$Edge$Type[var0.ordinal()]) {
     case 1:
        return EJumpType.JUMP_TRUE;
     case 2:
        return EJumpType.JUMP_FALSE;
     case 3:
        return EJumpType.UNCONDITIONAL;
     case 4:
        return EJumpType.SWITCH;
     default:
        throw new IllegalArgumentException("Invalid flow graph edge type");
  }
}

Additional information

You can extract BinExport2Reader.class from the attached archive BinExport2Reader.class.zip.

It's from BinDiff version 8. The source code for the class is available in BinExport2Reader.java. You can download the complete software from the BinDiff releases page.

@rohitab rohitab added the Type: Bug Something isn't working label Jun 8, 2024
@jaskarth jaskarth added Subsystem: Statement Structure Anything concerning how statements are structured in a method Priority: Low Low priority labels Jul 11, 2024
@jaskarth
Copy link
Member

Hello, I tried to replicate this bug but I couldn't reproduce it. Did you decompile the whole jar at once? Switch on enum data is stored in a separate class that must also be loaded when the switch is decompiled, otherwise Vineflower will be unable to retrieve the data within.

@jaskarth jaskarth added the needs-info Further information from the issue author is needed label Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-info Further information from the issue author is needed Priority: Low Low priority Subsystem: Statement Structure Anything concerning how statements are structured in a method Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants