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

ufuzz failure #3387

Closed
alexlamsl opened this issue Apr 28, 2019 · 0 comments · Fixed by #3388
Closed

ufuzz failure #3387

alexlamsl opened this issue Apr 28, 2019 · 0 comments · Fixed by #3388
Labels

Comments

@alexlamsl
Copy link
Collaborator

// original code
// (beautified)
var _calls_ = 10, a = 100, b = 10, c = 0;

a++ + (a = --b + ((c = c + 1) + (a++ + {
    foo: (c = c + 1) + [ , (c = c + 1) + (+function() {
    }() || a || 3).toString(), ++b ],
    b: (c = c + 1) + (a && a.c),
    null: a++ + (23..toString() || a || 3).toString(),
    "\t": (c = c + 1) + (typeof a == "function" && --_calls_ >= 0 && a(22)),
    "-2": a++
}[typeof f0 == "function" && --_calls_ >= 0 && f0(++a, 4, a++ + this)] || 7).toString()[0 === 1 ? a : b]));

console.log(null, a, b, c, Infinity, NaN, undefined);
// uglified code
// (beautified)
var o = 10, n = 100;

n++, n = "91" + ("" + (n++ + {
    foo: 2 + [ , 3 + (n || 3).toString(), 10 ],
    b: 4 + (n && n.c),
    null: n++ + "23",
    "\t": 5 + ("function" == typeof n && 0 <= --o && n(22)),
    "-2": n++
}["function" == typeof f0 && 0 <= --o && f0(++n, 4, n++ + this)] || 7))[10], console.log(null, n, 10, 5, 1 / 0, NaN, void 0);
original result:
�[1mnull�[22m �[33mNaN�[39m �[33m10�[39m �[33m5�[39m �[33mInfinity�[39m �[33mNaN�[39m �[90mundefined�[39m

uglified result:
�[1mnull�[22m �[32m'91undefined'�[39m �[33m10�[39m �[33m5�[39m �[33mInfinity�[39m �[33mNaN�[39m �[90mundefined�[39m

minify(options):
{
  "compress": {
    "passes": 1000000,
    "unsafe": true
  },
  "toplevel": true
}
@alexlamsl alexlamsl added the bug label Apr 28, 2019
alexlamsl added a commit to alexlamsl/UglifyJS that referenced this issue Apr 28, 2019
alexlamsl added a commit that referenced this issue Apr 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant