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

Closed
alexlamsl opened this issue Jun 19, 2024 · 0 comments · Fixed by #5855
Closed

ufuzz failure #5854

alexlamsl opened this issue Jun 19, 2024 · 0 comments · Fixed by #5855
Labels

Comments

@alexlamsl
Copy link
Collaborator

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

const [ NaN_2 ] = [ a = [ ((c = c + 1) + {
    in: --b + (typeof f1 == "function" && --_calls_ >= 0 && f1`${typeof foo === "special"}`),
    [(c = c + 1) + (typeof a == "function" && --_calls_ >= 0 && a()) ? 1 % 23..toString() - (/[a2][^e]+$/ >>> [ , 0 ][1]) | true + "" >>> (undefined == 4) : --b + (a && typeof a.set == "function" && --_calls_ >= 0 && a.set("function", --b, "foo"))]: a++ + /[abc4]/.test((undefined || b || 5).toString())
} || 9).toString()[b *= a] ] ];

NaN_2 && NaN_2.then;

a++ + ((c = c + 1) + (3 >= "undefined" > (NaN_2 && ({
    0: NaN_2[c = 1 + c, (1 % undefined && ("b" || 5)) >> ([] >>> undefined >> (/[a2][^e]+$/ != true))]
} = {
    0: /[a2][^e]+$/ > false
})) !== ("b" >>> 25 || -true)) || 4).toString()[(c = c + 1) + "bar"];

c = c + 1;

console.log(null, a, b, c, Infinity, NaN, undefined);
// uglified code
// (beautified)
var o, n = 10, t = 0, f = o = [ ("" + ((t += 1) + {
    in: --n + ("function" == typeof f1 && f1`${"special" == typeof foo}`),
    [(t += 1) + !1 ? 1 : --n + !1]: 100 + /[abc4]/.test((n || 5).toString())
} || 9))[n *= 101] ];

f && f.then, t += 1, f && ({
    0: f[t = 1 + t, 0]
} = {
    0: !1
}), console.log(null, ++o, n, t = t + 1 + 1, Infinity, NaN, void 0);
original result:
null 1 909 6 Infinity NaN undefined

uglified result:
null NaN 909 6 Infinity NaN undefined
// reduced test case (output will differ)

// (beautified)
var a;

const [ NaN_2 ] = [ a = [] ];

a++ + ({
    0: NaN_2[0]
} = {
    0: 1
});

console.log(a);
// output: 1
// 
// minify: 2
// 
// 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
  pure_getters
  reduce_vars
  side_effects
  unsafe
  varify

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