Skip to content

Heavily nested functions do not decompile correctly #5

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

Open
N3rdL0rd opened this issue Jun 30, 2024 · 0 comments
Open

Heavily nested functions do not decompile correctly #5

N3rdL0rd opened this issue Jun 30, 2024 · 0 comments

Comments

@N3rdL0rd
Copy link

I was poking around the Dead Cells bytecode with the GUI and noticed that a lot of functions seemed to cut off at a certain depth, even though the opcodes still had more instructions - so I wrote a small test class:

class Nested {
    static function main() {
        var b = 512.0;
        while (b > 5) {
            b /= 2;
            if (b < 10) {
                while (b < 100) {
                    b *= 2;
                    if (b > 50) {
                        break;
                    }
                }
            }
        }
    }
}

Once decompiled, it yields the following output:

class Nested {
    static function main() {
        var b = 512;
        while ([no condition]) {
            b = b / 2;
            while ([no condition]) {
                b = b * 2;
                break;
            }
        }
    }
}

I assume the [no condition] blocks are a separate issue - but the lack of nesting beyond a certain point is far more concerning when it comes to the overall accuracy of the decompilation.

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

No branches or pull requests

1 participant