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 #3531

Closed
alexlamsl opened this issue Oct 26, 2019 · 0 comments · Fixed by #3532
Closed

ufuzz failure #3531

alexlamsl opened this issue Oct 26, 2019 · 0 comments · Fixed by #3532
Labels

Comments

@alexlamsl
Copy link
Collaborator

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

function f0() {
    c = c + 1;
    {
        var expr2 = a++ + [ {
            var: a++ + (([ , 0 ].length === 2) + -4 >>> false / -0 >> (3 != []) % ("undefined" ^ -3)),
            3: --b + (typeof b_2 == "function" && --_calls_ >= 0 && b_2(2, "a")),
            in: b_2
        }[(c = c + 1) + (b_2 = ("foo" - false != ("object" == "foo")) % (22 * -4 >>> (-0 !== "foo")))], (c = c + 1) + (b + 1 - .1 - .1 - .1), a++ + /[abc4]/.test((a++ + (b += a) || b || 5).toString()), typeof f0 == "function" && --_calls_ >= 0 && f0((c = c + 1) + typeof {}, (c = c + 1) + --b, 25) ];
        for (var key2 in expr2) {
            c = 1 + c;
            var b_2 = expr2[key2];
            var b_2_1 = typeof f2 == "function" && --_calls_ >= 0 && f2(), b_1 = typeof f0 == "function" && --_calls_ >= 0 && f0("number");
        }
    }
}

var Math = f0([ , 0 ][1], -1, (c = c + 1) + void b);

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

function f0() {
    c += 1;
    var f = a++ + [ {
        var: a++ - 2,
        3: --b + ("function" == typeof n && 0 <= --_calls_ && n(2, "a")),
        in: n
    }[(c += 1) + (n = 1)], (c += 1) + (b + (.8 - .1)), a++ + /[abc4]/.test("" + (a++ + (b += a) || b || 5)), "function" == typeof f0 && 0 <= --_calls_ && f0((c += 1) + "object", (c += 1) + --b, 25) ];
    for (var o in f) {
        c = 1 + c;
        var n = f[o];
        "function" == typeof f2 && 0 <= --_calls_ && f2(), "function" == typeof f0 && 0 <= --_calls_ && f0("number");
    }
}

var Math = f0(0, -1, (c += 1) + void 0);

console.log(null, a, b, c, 1 / 0, NaN, void 0);
original result:
null 144 1353 352 Infinity NaN undefined

uglified result:
null 144 1353 214 Infinity NaN undefined

minify(options):
{
  "compress": {
    "keep_fargs": false,
    "passes": 1000000,
    "sequences": 1000000,
    "unsafe": true,
    "unsafe_Function": true,
    "unsafe_math": true,
    "unsafe_proto": true,
    "unsafe_regexp": true
  }
}
@alexlamsl alexlamsl added the bug label Oct 26, 2019
alexlamsl added a commit to alexlamsl/UglifyJS that referenced this issue Oct 26, 2019
alexlamsl added a commit to alexlamsl/UglifyJS that referenced this issue Oct 26, 2019
alexlamsl added a commit that referenced this issue Oct 27, 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