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

CFR may mix value '0' and 'false' in a invalid way #330

Open
AIRTEspresso opened this issue Aug 12, 2022 · 0 comments
Open

CFR may mix value '0' and 'false' in a invalid way #330

AIRTEspresso opened this issue Aug 12, 2022 · 0 comments
Labels

Comments

@AIRTEspresso
Copy link

CFR version

CFR version: 0.152

Compiler

Java openJDK, version: 11.0.13

Description

Here is another case that CFR may generate invalid Java code. In this example, CFR may mix value '0' and 'false', would you like to have a look? The total case is available at error example and I hope it can be helpful.

Example

The source code:

        int i20 = 35;
        boolean bArr1[]= new boolean[N];
        switch(30){
            case 32 : {
                boolean b2 = false;
                bArr1[i20]= b2;
            }
            short s1 = 31371;
        }

The code decompiled by CFR:

        int n = 35;
        boolean[] blArray = new boolean[this.N];
        switch (30) {
            case 32: {
                int n2;
                blArray[n] = n2 = 0;
                n2 = 31371;
            }
        }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant