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

Closed
alexlamsl opened this issue Sep 8, 2022 · 0 comments · Fixed by #5654
Closed

ufuzz failure #5653

alexlamsl opened this issue Sep 8, 2022 · 0 comments · Fixed by #5654
Labels

Comments

@alexlamsl
Copy link
Collaborator

// original code
//

var _calls_ = 10, a = 100, b = 10, c = 0;






if (((c = c + 1) + (((c = c + 1) + (b/* ignore */--)) ? ((--b) + (a && a.set)) : ((--b) + (a))))){var brake2 = 5; do {var c_2 = ((c = c + 1) + ([((c = c + 1) + (b += a)), ((c = c + 1) + (b += a)), ((c = c + 1) + ((-0) in [])), ((c = c + 1) + (c_2))].set)), b_1 = (((b_1_2, a) => {




{var foo_1 = function f0(Infinity_1){




function f1(bar_2, NaN_2){




(c = 1 + c, (a && (a.b=(((23..toString()||null)*(undefined^""))>=((24 .toString()<<0)&([,0][1] - "bar"))))));

}
var a = f1([], ((--b) + (b_1 && b_1.value)), ((--b) + (++b)));

}
((24 .toString()));}
{var await = function f2(){




L25676: for (var brake7 = 5; ( /[abc4]/.test(((--/* ignore */b) || b || 5).toString()) ) && brake7 > 0; --brake7){var expr8 = ((--b) + (({
null: (c = 1 + c, ((foo_1=((this>="object")/(([,0].length === 2) + 1))),((""/(-5)) - ((-2),25. )))),
set c(b_1_2_2){




;
this.foo>>=((-5)<(-0));
},
}).get));  for (var key8 in expr8) {c = 1 + c; var bar_1 = expr8[key8]; ;}}

}
`${((--b) + (+((((b_1/=("object"<=(-2)))&&(({})*1))>=(( /[a2][^e]+$/ ||([,0].length === 2))<=(b_1 && (b_1[(c = 1 + c, ((("bar"^"foo")>>((-2)!=""))^(("c"^false)&&("a"<"function"))))]=("number"==="a"))))))))}\\`;}
{


var a = (({
1.5: ([(c = 1 + c, (c = c + 1, ((2*2)||(this%0))))]),
Infinity: ("undefined"),
}));
return (a++ + (typeof f2 == "function" && --_calls_ >= 0 && f2((-1))));
c = c + 1;
for (var brake14 = 5; (b /= a) && brake14 > 0; --brake14)try {{


(c = 1 + c, ((!((23..toString()%4)))>>>(("function"&&0x26.toString())%([,0][1]^"undefined"))));
} } catch (bar_2) { 


{var expr18 = (c = 1 + c, (((a+=( /[a2][^e]+$/ &&"function"))===((-4)&0))|(("foo"*false)===(([,0].length === 2)%"number"))));  for (var [ key18 ] in expr18) {(c = 1 + c, (bar_2 && (bar_2[((b = a))]&=((a && ({ a: a.then } = { a: ((~(23..toString()))>=(null<5)) }))<(await=((4,"undefined")%(delete (undefined))))))));}}
for (var brake20 = 5; (c = 1 + c, ((c = c + 1, (b_1_2 && (b_1_2[(c = 1 + c, (void (((a && (a[(c = 1 + c, (b_1 && (b_1.done=(((-(24 .toString())) - (24 .toString()>null))==(((-4)>=Infinity)&&(false%"foo"))))))]=("number"&&"object")))&&(4=="")))))]=(24 .toString()<="bar"))))||(([,0][1]|(-4))<=(1<="foo")))) && brake20 > 0; --brake20)(c = 1 + c, (((NaN^2)!==(4,(-3)))<((5>"b")*("object"^ /[a2][^e]+$/ ))));
 } finally { 


switch ((c = 1 + c, (foo_1 && (foo_1.NaN%=((((-5)==([,0].length === 2))>>(c = c + 1,  /[a2][^e]+$/ ))&((false<23..toString())&(3|"object"))))))) { 
case (c = 1 + c, (((false|[,0][1])>=(2^({})))>>>(a && (a.NaN^=(((-5)>>NaN)==(true<false)))))):
;
 break;

case (c = 1 + c, (((Infinity&&[,0][1])==(24 .toString()&&[])) + (([,0][1]^0x26.toString()) + ([,0][1]!=24 .toString())))):
;
 break;

case (c = 1 + c, (((3<<4)^("a"*1))^((4<="undefined")|("foo" + null)))):
;
 break;

case (c = 1 + c, (await && (await.get|=((delete ((NaN|22)))<<((1<<22)^("undefined"||(-5))))))):
;
 break;
}
c = c + 1;
 }
}
;
{var a_1 = function f3(){




;
var a = ("a" in [(c = 1 + c, ((((-0)>undefined)<<(""===1))==((([,0].length === 2)&this)<=([,0][1]<<Infinity))))]), yield = ( (([,0][1] in ({
NaN: (c = 1 + c, ((([]>>>"b")>(5^""))===((1*this) + (1^0)))),
async: (c = 1 + c, ((((-5) + 0x26.toString())!=(c_2 && (c_2[(c = 1 + c, (b_1 && (b_1[(++/* ignore */a)]*=(((false!==undefined)&&(Infinity&&0))===(~(("object"==false)))))))]=(undefined<Infinity))))^(((-5) - 22)^( /[a2][^e]+$/ &"undefined")))),
})) || 1).toString()[(a++ + (({
})))] );

}
((({
...(typeof f3 == "function" && --_calls_ >= 0 && f3(...[])),
NaN: (b = a),
}).c),  /[a2][^e]+$/ );}

}));} while (( /[abc4]/.test((((typeof (a++ + (b_1 && b_1[(1 === 1 ? a : b)])))) || b || 5).toString()) ) && --brake2 > 0);}
(b_1 && b_1.a);

console.log(null, a, b, c, Infinity, NaN, undefined);
// !!! uglify failed !!!
Error: body must be empty if value exists
    at AST_Arrow._validate (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:1067:41)
    at AST_Arrow.validate (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:415:38)
    at AST_Arrow.ctor.transform (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:509:22)
    at AST_Arrow.eval [as hoist_properties] (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:14875:14)
    at Compressor.eval (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:6548:14)
    at AST_Arrow.eval [as transform] (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2884:31)
    at AST_Arrow.ctor.transform (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:507:34)
    at eval (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2833:33)
    at Compressor.eval (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:6559:5)
    at AST_Assign.eval [as transform] (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2884:31)
    at AST_Assign.ctor.transform (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:507:34)
    at eval (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2702:25)
    at List (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:103:23)
    at do_list (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2701:16)
    at eval (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2810:28)
    at Compressor.eval (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:6559:5)
    at AST_Sequence.eval [as transform] (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2884:31)
    at AST_Sequence.ctor.transform (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:507:34)
    at eval (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2727:61)
    at Compressor.eval (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:6559:5)
    at AST_For.eval [as transform] (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2884:31)
    at AST_For.ctor.transform (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:507:34)
    at eval (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2748:31)
    at Compressor.eval (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:6559:5)
    at AST_If.eval [as transform] (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2884:31)
    at AST_If.ctor.transform (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:507:34)
    at eval (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2702:25)
    at List (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:103:23)
    at do_list (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2701:16)
    at eval (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2715:21)
    at Compressor.eval (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:6559:5)
    at AST_Toplevel.eval [as transform] (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2884:31)
    at AST_Toplevel.ctor.transform (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:507:34)
    at Compressor.compress (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:6599:21)
    at Object.minify (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:24458:57)
    at /home/runner/work/UglifyJS/UglifyJS/test/ufuzz/index.js:2564:32
    at Array.forEach (<anonymous>)
    at Object.<anonymous> (/home/runner/work/UglifyJS/UglifyJS/test/ufuzz/index.js:2556:20)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Function.Module.runMain (module.js:694:10)
    at startup (bootstrap_node.js:204:16)
    at bootstrap_node.js:625:3
// reduced test case (output will differ)

// (beautified)
var b_1 = a => {
    0`${b_1 /= 0}\\`;
    var a = {
        1.5: c
    };
    return a++;
    a[0] = 0;
};

b_1.a;
// minify error: Error: body must be empty if value exists
//     at AST_Arrow._validate (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:1067:41)
//     at AST_Arrow.validate (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:415:38)
//     at AST_Arrow.ctor.transform (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:509:22)
//     at AST_Arrow.eval [as hoist_properties] (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:14875:14)
//     at Compressor.eval (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:6548:14)
//     at AST_Arrow.eval [as transform] (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2884:31)
//     at AST_Arrow.ctor.transform (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:507:34)
//     at eval (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2773:49)
//     at Compressor.eval (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:6559:5)
//     at AST_VarDef.eval [as transform] (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2884:31)
//     at AST_VarDef.ctor.transform (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:507:34)
//     at eval (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2702:25)
//     at List (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:103:23)
//     at do_list (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2701:16)
//     at eval (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2769:28)
//     at Compressor.eval (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:6559:5)
//     at AST_Var.eval [as transform] (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2884:31)
//     at AST_Var.ctor.transform (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:507:34)
//     at eval (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2702:25)
//     at List (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:103:23)
//     at do_list (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2701:16)
//     at eval (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2715:21)
//     at Compressor.eval (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:6559:5)
//     at AST_Toplevel.eval [as transform] (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:2884:31)
//     at AST_Toplevel.ctor.transform (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:507:34)
//     at Compressor.compress (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:6599:21)
//     at Object.minify (eval at <anonymous> (/home/runner/work/UglifyJS/UglifyJS/tools/node.js:18:1), <anonymous>:24458:57)
//     at test_minify (/home/runner/work/UglifyJS/UglifyJS/test/reduce.js:815:22)
//     at reduce_test (/home/runner/work/UglifyJS/UglifyJS/test/reduce.js:636:16)
//     at log (/home/runner/work/UglifyJS/UglifyJS/test/ufuzz/index.js:2270:23)
//     at /home/runner/work/UglifyJS/UglifyJS/test/ufuzz/index.js:2653:80
//     at Array.forEach (<anonymous>)
//     at Object.<anonymous> (/home/runner/work/UglifyJS/UglifyJS/test/ufuzz/index.js:2556:20)
//     at Module._compile (module.js:653:30)
//     at Object.Module._extensions..js (module.js:664:10)
//     at Module.load (module.js:566:32)
//     at tryModuleLoad (module.js:506:12)
//     at Function.Module._load (module.js:498:3)
//     at Function.Module.runMain (module.js:694:10)
//     at startup (bootstrap_node.js:204:16)
//     at bootstrap_node.js:625:3
// options: {
//   "compress": {
//     "hoist_vars": true,
//     "keep_infinity": true,
//     "passes": 1000000,
//     "unsafe": true
//   },
//   "keep_fargs": 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_fargs": true,
  "keep_fnames": true,
  "toplevel": true,
  "mangle": {
    "v8": true
  },
  "output": {
    "v8": true
  }
}

Suspicious compress options:
  arrows
  dead_code
  hoist_props
  passes
  reduce_vars
  sequences
  side_effects
  unused

Suspicious options:
  keep_fnames
@alexlamsl alexlamsl added the bug label Sep 8, 2022
alexlamsl added a commit to alexlamsl/UglifyJS that referenced this issue Sep 8, 2022
alexlamsl added a commit that referenced this issue Sep 8, 2022
alexlamsl added a commit to alexlamsl/UglifyJS that referenced this issue Sep 8, 2022
- improve fix for mishoo#5653
alexlamsl added a commit that referenced this issue Sep 8, 2022
- improve fix for #5653
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