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

Closed
alexlamsl opened this issue Jul 31, 2024 · 0 comments · Fixed by #5901
Closed

ufuzz failure #5899

alexlamsl opened this issue Jul 31, 2024 · 0 comments · Fixed by #5901
Labels

Comments

@alexlamsl
Copy link
Collaborator

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

({
    foo: (c = c + 1) + (typeof f1 == "function" && --_calls_ >= 0 && f1((c = c + 1) + (("foo" && -3) / (24..toString() >> ([ , 0 ].length === 2)) === ("number" || -2 || (c = c + 1, 
    {}))), (c = c + 1) + (a && typeof a.Infinity == "function" && --_calls_ >= 0 && a.Infinity((c = c + 1) + [])), undefined))
});

var foo = ({
    1.5: a
} = a || {}), yield = --b + [], bar;

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

o += 1, "function" == typeof f1 && f1((o += 1) + (-3 / ("24" >> (2 === [ , 0 ].length)) === "number"), (o += 1) + !1, void 0), 
console.log(null, ({
    1.5: n
} = 100), 9, o, Infinity, NaN, void 0);
original result:
null undefined 9 1 Infinity NaN undefined

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

// (beautified)
var a = 100;

console.log(a && a);

var foo = ({
    1.5: a
} = a);

console.log(a);
// output: 100
// undefined
// 
// minify: 100
// 100
// 
// 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
  hoist_vars
  reduce_vars
  unsafe

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