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

infinite deep clone in function inlining #2442

Closed
kzc opened this issue Nov 6, 2017 · 3 comments · Fixed by #2446
Closed

infinite deep clone in function inlining #2442

kzc opened this issue Nov 6, 2017 · 3 comments · Fixed by #2446
Labels

Comments

@kzc
Copy link
Contributor

kzc commented Nov 6, 2017

Bug report or feature request?

bug

ES5 or ES6+ input?

both

Uglify version (uglifyjs -V)

3.1.7

JavaScript input

$ cat clone_bug.js 
!function() {
    function foo() {
        bar();
    }
    function bar() {
        foo();
    }
}();
$ bin/uglifyjs clone_bug.js -c
ERROR: Maximum call stack size exceeded

Any number of functions can be involved:

$ cat clone_bug2.js 
!function() {
    function foo() { bar(); }
    function bar() { qux(); }
    function qux() { foo(); }
}();
$ bin/uglifyjs clone_bug2.js -c
ERROR: Maximum call stack size exceeded

related issue: #2438

@kzc kzc changed the title infinite deep clone infinite deep clone in function inlining Nov 6, 2017
@kzc
Copy link
Contributor Author

kzc commented Nov 6, 2017

@alexlamsl If we mark AST_Lambda instances that have already been inlined that ought to take care of this.

@alexlamsl
Copy link
Collaborator

Thanks for isolating this – I now get to have a full head of hair for another decade.

Unfortunately I can only fix this later on this evening, so 3.1.8 will need to wait for (early) tomorrow.

@kzc
Copy link
Contributor Author

kzc commented Nov 6, 2017

Fixed in #2445
Fixed in #2446.

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