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

Function executor does not deal with array of literals and deletes code even if no replacement is found #33

Closed
canpadawan opened this issue Sep 20, 2022 · 1 comment

Comments

@canpadawan
Copy link

The following snippet does not simplify

function _0x1661() {
    "#execute";
    return ["str1", "str2"];
}
const foo = _0x1661()[0];

FunctionExecutor.replaceFunctionCalls() tries to replace the call by a literal value and fails (since we have a table of literals), so nothing gets replaced in the foo assigment (and cannot be simplified further).

The output is also not sound since the function is removed and the code can no longer be executed. Output is:

const foo = _0x1661()[0];

I don't know much about javascript, so there might be good reasons for not handling this. What you think?

@ben-sb
Copy link
Owner

ben-sb commented Oct 5, 2022

Should be sorted in 7b2a9ee

@ben-sb ben-sb closed this as completed Oct 5, 2022
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

2 participants