Skip to content

ufuzz failure #5779

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

Closed
alexlamsl opened this issue Jan 16, 2023 · 0 comments · Fixed by #5780
Closed

ufuzz failure #5779

alexlamsl opened this issue Jan 16, 2023 · 0 comments · Fixed by #5780
Labels

Comments

@alexlamsl
Copy link
Collaborator

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

const arguments_2 = b = a;

{
    var brake1 = 5;
    do {
        --b + -delete (~true == (arguments_2 && (arguments_2.next |= 4 / "undefined")));
    } while (--b + (arguments_2 && arguments_2.next) && --brake1 > 0);
}

console.log(null, a, b, c, Infinity, NaN, undefined);
// uglified code
// (beautified)
for (var n = 10, o = (n = 100, 5); --n, --n + (100..next |= NaN) && 0 < --o; ) {}

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

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

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

const arguments_2 = b = a;

do {
    arguments_2 && (arguments_2.next |= 0);
} while (--b + (arguments_2 && arguments_2.next));

console.log(b);
// output: 99
// 
// minify: 0
// 
// options: {
//   "compress": {
//     "hoist_vars": true,
//     "keep_infinity": true,
//     "passes": 1000000,
//     "unsafe": true
//   },
//   "keep_fargs": true,
//   "keep_fnames": true,
//   "module": false,
//   "toplevel": true,
//   "output": {
//     "v8": true
//   },
//   "validate": true
// }
minify(options):
{
  "compress": {
    "hoist_vars": true,
    "keep_infinity": true,
    "passes": 1000000,
    "unsafe": true
  },
  "keep_fargs": true,
  "keep_fnames": true,
  "module": false,
  "toplevel": true,
  "output": {
    "v8": true
  }
}

Suspicious compress options:
  collapse_vars
  evaluate
  loops
  passes
  pure_getters
  reduce_vars
  side_effects
  unused

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