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

Closed
alexlamsl opened this issue May 11, 2020 · 0 comments · Fixed by #3885
Closed

ufuzz failure #3884

alexlamsl opened this issue May 11, 2020 · 0 comments · Fixed by #3885
Labels

Comments

@alexlamsl
Copy link
Collaborator

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

{
    (c = c + 1) + ((a++ + a || a || 3).toString() || 1).toString()[typeof c_2 !== "crap"];
    {
        var expr3 = (c = c + 1) + (b <<= a);
        L15982: for (var key3 in expr3) {
            c = 1 + c;
            var foo_1 = expr3[key3];
        }
    }
}

void (foo_1 && (foo_1.var -= 3 > 22 === 4 >>> -2 === delete (c = c + 1, -3)));

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

r += 1;

var v = (r += 1) + (a <<= 101);

for (var o in v) {
    r = 1 + r;
    var l = v[o];
}

l && (l.var -= 0 == (r += 1, !0)), console.log(null, 101, 160, r, 1 / 0, NaN, void 0);
original result:
null 101 320 2 Infinity NaN undefined

uglified result:
null 101 160 2 Infinity NaN undefined
// reduced test case (output will differ)

// (beautified)
var a = 100, b = 1;

{
    a++ + a || a;
    b <<= a;
}

console.log(a, b);
// output: 101 32
// 
// minify: 101 16
// 
// options: {
//   "compress": {
//     "passes": 1000000,
//     "unsafe": true
//   },
//   "toplevel": true
// }
minify(options):
{
  "compress": {
    "passes": 1000000,
    "unsafe": true
  },
  "toplevel": true
}

Suspicious compress options:
  collapse_vars
  evaluate
  pure_getters
  reduce_vars
  side_effects
  unsafe
  unused

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