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

Closed
alexlamsl opened this issue May 12, 2020 · 0 comments · Fixed by #3890
Closed

ufuzz failure #3889

alexlamsl opened this issue May 12, 2020 · 0 comments · Fixed by #3890
Labels

Comments

@alexlamsl
Copy link
Collaborator

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

function f0(bar, a_2) {
    {
        return [ 1 === 1 ? a : b, typeof f0 == "function" && --_calls_ >= 0 && f0(), [ (!"foo" != (a_2 = 4 | 2)) < (-4 >> true !== (-4 == "")), a_2, +function a_2() {
            var a_2;
            var b_1 = (c = c + 1) + (a_2 && a_2[c = 1 + c, b_1 += (NaN || Infinity) > (NaN === 24..toString()) ^ ((c = c + 1, 
            this) | (b_1 && (b_1[c = 1 + c, ("number" & 0) > ("number" < NaN) & (38..toString() ^ -5 ^ (c = c + 1, 
            "function"))] = [] + 4)))]);
            c = c + 1;
        }() ].a, !a ][b ^= a];
    }
    for (var brake5 = 5; --b + void a && brake5 > 0; --brake5) {}
}

var Infinity_2 = f0(Infinity_2 && typeof Infinity_2.length == "function" && --_calls_ >= 0 && Infinity_2.length(), -3);

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

var n = function f(n, t) {
    return [ o, 0 <= --i && f(), [ (0 != (t = 6)) < !0, 6, +function t() {
        var n = (e += 1) + 6[e = 1 + e, n += (NaN || Infinity) > (NaN === 24..toString()) ^ (e += 1, 
        this | (n && (n[e = 1 + e, "number" < NaN < 0 & (-5 ^ 38..toString() ^ (e += 1, 
        "function"))] = [] + 4)))];
        e += 1;
    }() ].a, !o ][a ^= o];
}(n && "function" == typeof n.length && 0 <= --i && n.length(), -3);

console.log(null, o, a, e, Infinity, NaN, undefined);
original result:
null 100 110 22 Infinity NaN undefined

uglified result:
null 100 110 44 Infinity NaN undefined
// reduced test case (output will differ)

// (beautified)
function f0(a_2) {
    return [ a_2 = 0, function a_2() {
        var a_2;
        console.log(a_2);
    }() ];
}

f0();
// output: undefined
// 
// minify: 0
// 
// options: {
//   "ie8": true,
//   "toplevel": true
// }
minify(options):
{
  "ie8": true,
  "toplevel": true
}

Suspicious compress options:
  evaluate
  reduce_vars

Suspicious options:
  ie8
@alexlamsl alexlamsl added the bug label May 12, 2020
alexlamsl added a commit to alexlamsl/UglifyJS that referenced this issue May 12, 2020
alexlamsl added a commit that referenced this issue May 12, 2020
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