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 on inline #3018

Closed
alexlamsl opened this issue Mar 22, 2018 · 0 comments · Fixed by #3019
Closed

ufuzz failure on inline #3018

alexlamsl opened this issue Mar 22, 2018 · 0 comments · Fixed by #3019
Labels

Comments

@alexlamsl
Copy link
Collaborator

https://travis-ci.org/alexlamsl/UglifyJS2/builds/356952289

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

var a_2 = (c = c + 1) + ((b >>= a) || a || 3).toString(), bar_2 = !((bar_2 = [ , 0 ][1] > undefined && (-2 || [ , 0 ].length === 2)) === (-0 == NaN) >>> (24..toString() !== "number"));

{
    var brake2 = 5;
    L10388: do {
        a++ + a--;
    } while (({
        "-2": typeof f0 == "function" && --_calls_ >= 0 && f0(),
        var: a_2 = typeof a_2 == "function" && --_calls_ >= 0 && a_2("number", false, /[a2][^e]+$/),
        undefined: (c = c + 1) + typeof ((c = c + 1) + /[abc4]/.test(((--b + ++a ? (c = c + 1) + (b &= a) : a++ + typeof /[abc4]/.test((([] * "" != ("c" ^ "a")) * (a_2 && (a_2.Infinity = this % 3 < (23..toString() ^ [ , 0 ][1]))) || b || 5).toString())) || b || 5).toString())),
        var: a++ + [ --b, ((4 ? typeof (--b + {
            1.5: (c = 1 + c, (bar_2 += undefined === []) < (4 | []) == 1 << "b" >> (5 != [ , 0 ][1])),
            a: (c = 1 + c, ("b" ^ -4) - (4 == "function") ^ -4 << "foo" < false >>> "bar"),
            a: (c = 1 + c, ([ , 0 ][1] || [ , 0 ].length === 2) == "function" % 38..toString() != (undefined - 25 ^ false !== ([ , 0 ].length === 2))),
            var: (c = 1 + c, ("undefined" ^ []) <= "undefined" * null < ((a_2 && (a_2.a = {} % 22)) != 3 <= "a"))
        }.undefined) : (2 ^ 24..toString(), "function" / {}) & (bar_2 += ([ , 0 ].length === 2) < 5) >= (2 ^ "b")) || 3).toString()[--b + ((a_2 = (((c = 1 + c, 
        ~-0 >> (-2 ^ "object") < ((38..toString() || 38..toString()) > (-2 === -1))) ? (c = 1 + c, 
        "bar" / "foo" <= (-2 < NaN) | null < [ , 0 ][1] >= 3 * this) : (c = 1 + c, "foo" + "undefined" >>> ([ , 0 ].length === 2 ^ "number") ^ "c" >= "undefined" & (c = c + 1, 
        22))) || a || 3).toString()) ? (c = c + 1) + (a++ + (1 === 1 ? a : b) || a || 3).toString() : [ NaN, ++a, ~b ].NaN)], a++ + /[abc4]/.test(((--b + [ (c = 1 + c, 
        Infinity % this === ("c" || -4), a_2 && (a_2[--b + delete (+(c = c + 1, "function") == (2 << 38..toString()) * ("bar" > -0))] += (25 << {}, 
        3 & /[a2][^e]+$/))), (c = 1 + c, undefined >= 5 != "" % 5 && -2 >= "object" < (a_2 && (a_2[(c = 1 + c, 
        c = c + 1, -(4 / "foo"))] >>>= "number" < "bar"))), (c = 1 + c, (a_2 += ~"bar" && 3 >> "object") !== (c = c + 1, 
        this, "bar" && false)), (c = 1 + c, c = c + 1, -2 << 5 <= ("" === "number")) ].b ? a++ + [] : a++ + [ (c = 1 + c, 
        "a" / "undefined" * (1 * 38..toString()) <= ("c" & 4) - (false !== false)), , (c = 1 + c, 
        a_2 && (a_2[a_2 && a_2[a++ + typeof arguments]] = (true === -3) - ([ , 0 ][1] ^ Infinity) << (("number", 
        "number") <= NaN >> []))), ,  ]) || b || 5).toString()), !function Math() {
            {
                var c_2 = function f0(a, bar_2, parseInt_2) {
                    c = 1 + c, (([ , 0 ].length === 2, "bar") >> "" * 3) - (parseInt_2 = "c" * -5 != (parseInt_2 && (parseInt_2[(c = 1 + c, 
                    parseInt_2 && (parseInt_2[a++ + function() {
                        c = 1 + c, (Infinity > -5 == (true !== 2)) - (a_2 && (a_2[[ (c = 1 + c, (true % "undefined" !== /[a2][^e]+$/ < 23..toString()) <= (/[a2][^e]+$/ * null !== (bar_2 && (bar_2.b = [ , 0 ][1] * Infinity)))), (c = 1 + c, 
                        ([ , 0 ][1] & "") >>> (NaN >>> 3) >>> ((-4 || "number") != (c = c + 1, Infinity))) ].a] = /[a2][^e]+$/ >= -4 != (/[a2][^e]+$/, 
                        24..toString())));
                    }()] = (Infinity > NaN) % ("function" !== []) > (bar_2 && (bar_2.foo *= ~/[a2][^e]+$/ - (c = c + 1, 
                    4)))))] &= "foo" || undefined)));
                    c = 1 + c, (-1 && 4 && -2 === "foo") == +!"b";
                }("number");
            }
            (-1 && 3) / (2 !== 0) <= ("foo" & true) >> (-5 && "a");
        }() ][(c = c + 1) + a_2]
    } ? 0 === 1 ? a : b : a++ + (typeof parseInt === "crap")) && --brake2 > 0);
}

console.log(null, a, b, c, Infinity, NaN, undefined);
// uglified code
// (beautified)
for (var t, n, o, i = 10, e = 100, r = 10, a = 0, N = (a += 1) + ((r >>= e) || e || 3).toString(), g = !((g = !1) === !1 >>> ("number" !== 24..toString())), f = 5; e++, 
e--, "function" == typeof f0 && 0 <= --i && f0(), N = "function" == typeof N && 0 <= --i && N("number", !1, /[a2][^e]+$/), 
a += 1, a += 1, /[abc4]/.test(((--r + ++e ? (a += 1) + (r &= e) : e++ + typeof /[abc4]/.test((("" * [] != 0) * (N && (N.Infinity = this % 3 < (0 ^ 23..toString()))) || r || 5).toString())) || r || 5).toString()), 
e++, --r, (typeof (--r + {
    1.5: (a = 1 + a, (g += void 0 === []) < (4 | []) == 0),
    a: (a = 1 + a, -3),
    a: (a = 1 + a, 2 === [ , 0 ].length == "function" % 38..toString() != (NaN ^ !1 != (2 === [ , 0 ].length))),
    var: (a = 1 + a, ("undefined" ^ []) <= NaN < (0 != (N && (N.a = {} % 22))))
}.undefined) || 3).toString()[--r + ((N = (a = 1 + a, (-1 < (!1 < (38..toString() || 38..toString())) ? (a = 1 + a, 
!1 | 3 * this <= !1) : (a = 1 + a, "fooundefined" >>> (2 === [ , 0 ].length ^ "number") ^ !1 & (a += 1, 
22))) || e || 3).toString()) ? (a += 1) + (e++ + e || e || 3).toString() : [ NaN, ++e, ~r ].NaN)], 
e++, /[abc4]/.test(((--r + [ (a = 1 + a, N && (N[--r + (a += 1, 38..toString(), 
!0)] += 0)), (a = 1 + a, !1), (a = 1 + a, (N += 3) !== (a += 1, !1)), (a = 1 + a, 
a += 1, !0) ].b ? e++ + [] : e++ + [ (a = 1 + a, NaN * (1 * 38..toString()) <= 0), , (a = 1 + a, 
N && (N[N && N[e++ + typeof arguments]] = 0 << ("number" <= NaN >> []))), ,  ]) || r || 5).toString()), 
t = "number", a = 1 + a, o = NaN != (o && (o[(a = 1 + a, o && (o[t++ + (a = 1 + a, 
void (N && (N[[ (a = 1 + a, (NaN !== /[a2][^e]+$/ < 23..toString()) <= (NaN !== (n && (n.b = NaN)))), (a = 1 + a, 
0 >>> (-4 != (a += 1, 1 / 0))) ].a] = 0 != 24..toString())))] = !1 % ("function" !== []) > (n && (n.foo *= -1 - (a += 1, 
4)))))] &= "foo")), a = 1 + a, a += 1, r && 0 < --f; ) {}

console.log(null, e, r, a, 1 / 0, NaN, void 0);
original result:
null 130 40 111 Infinity NaN undefined

uglified result:
null 130 40 131 Infinity NaN undefined

minify(options):
{
  "toplevel": true
}

Suspicious compress options:
  inline
  sequences
  side_effects
  unused

Suspicious options:
  rename
@alexlamsl alexlamsl added the bug label Mar 22, 2018
alexlamsl added a commit to alexlamsl/UglifyJS that referenced this issue Mar 22, 2018
alexlamsl added a commit to alexlamsl/UglifyJS that referenced this issue Mar 22, 2018
alexlamsl added a commit that referenced this issue Mar 22, 2018
kzc referenced this issue in terser/terser May 4, 2018
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