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

Closed
alexlamsl opened this issue Jan 15, 2021 · 0 comments · Fixed by #4559
Closed

ufuzz failure #4558

alexlamsl opened this issue Jan 15, 2021 · 0 comments · Fixed by #4559
Labels

Comments

@alexlamsl
Copy link
Collaborator

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

var b = NaN >>>= (c = c + 1) + (b >>>= a), NaN = (c = c + 1) + (typeof f0 == "function" && --_calls_ >= 0 && f0());

b && b[a++ + (NaN && NaN.a)];

console.log(null, a, b, c, Infinity, NaN, undefined);
// uglified code
// (beautified)
var n = 2 + ("function" == typeof f0 && f0());

console.log(null, 101, 0, 2, Infinity, n, void 0);
original result:
null 100 0 2 Infinity 2 undefined

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

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

var b = NaN >>>= b >>>= a, NaN = "function";

b && b[a++];

console.log(a, NaN);
// output: 0 'function'
// 
// minify: 1 'function'
// 
// options: {
//   "compress": {
//     "hoist_vars": true,
//     "keep_infinity": true,
//     "passes": 1000000,
//     "unsafe": true
//   },
//   "keep_fnames": true,
//   "toplevel": true,
//   "mangle": {
//     "v8": true
//   },
//   "output": {
//     "v8": true
//   },
//   "validate": true
// }
minify(options):
{
  "compress": {
    "hoist_vars": true,
    "keep_infinity": true,
    "passes": 1000000,
    "unsafe": true
  },
  "keep_fnames": true,
  "toplevel": true,
  "mangle": {
    "v8": true
  },
  "output": {
    "v8": true
  }
}

Suspicious compress options:
  dead_code
  evaluate
  hoist_vars
  passes
  pure_getters
  reduce_vars
  sequences
  side_effects
  unused

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