-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Bug in cascade
#2107
Comments
So far narrowed down to: var a = 100, b = 10, c = 0;
function f0(b) {
var b = function f1() {
{
var bar = function f2(arguments) {
if (c = 1 + c, ((1 ^ NaN) > (undefined && "number")) >>> "number" % Infinity % (38..toString() % -5)) {
c = 1 + c, a && (a.Infinity = ((-3 ^ Infinity) - {} * "foo") % (3 & 4 | ("undefined" || -3)));
}
}([ (c = 1 + c, "foo" - ([ , 0 ].length === 2) !== 0 % true ^ (Infinity, 3) % ([] == 4)) ][(c = c + 1) + -a]);
}
}(a++ + new function() {
this.NaN = ((("" ^ -2) <= (a && (a.a = undefined == undefined))) >>> ("foo" + -0 === "object" <= 3) === ("number" === []) * (23..toString() <= -5) * (a && (a[a++ + -0] = ("number" & [ , 0 ][1]) + (false === 0)))) >> (~(23..toString() | /[a2][^e]+$/) >> {} % ([ , 0 ].length === 2) % (25 > "object") || (a && (a[[ (c = 1 + c,
(("undefined" ^ "undefined") & ([ , 0 ].length === 2) >>> 3) << (2 >>> 4 !== ({} ^ -1))), (c = 1 + c,
(c = c + 1, "undefined") > (a && (a[(c = 1 + c, 3 - -5 <= (1 ^ "number") ^ void (a && (a[(c = 1 + c,
a && (a.undefined >>= (a && (a.var += (false == "bar", -3 !== 0))) & (false | 24..toString()) === ("undefined" !== -4)))] |= "number" == false)))] += null & "bar")),
5 != 0 != ("function" && [ , 0 ].length === 2)) ]] += ({} | 0) > (2 || "function"))) !== ((a && (a[(c = 1 + c,
(a && (a[b %= a] >>>= 5 !== "undefined" || "foo" % 5)) + ((a && (a[(c = 1 + c, (23..toString() <= "bar") << Infinity % null ^ (3 % {} || 3 * -5))] = -3 >= "undefined")) < /[a2][^e]+$/ / 3))] = undefined && -0)) !== -4 <= []));
this.a += (NaN > /[a2][^e]+$/ > (-0 ^ 4) !== ("object" <= 2) - (a && (a.a >>>= -0 >> 1)) ^ (c = c + 1,
c = c + 1, /[a2][^e]+$/ || {})) << ((5 ^ NaN | null > 1) & -3 % -2 != 1 >> "bar") / (2 + "undefined" && void "object" && ("undefined" >= 3) >>> ([ , 0 ].length === 2 & -3));
var undefined_2 = void b, bar_1 = (c = c + 1) + [ (c = 1 + c, (/[a2][^e]+$/ || Infinity) * ("function" ^ []) << (5 - undefined != ("function" && NaN))) ].a;
return a++ + (typeof bar_1 == "object");
}());
}
var b = f0();
console.log(null, a, b, c); $ uglifyjs test.js -b bracketize -c cascade=0 -o good.js
$ uglifyjs test.js -b bracketize -c cascade=1 -o bad.js
$ cat test.js | node
null 103 undefined 7
$ cat good.js | node
null 103 undefined 7
$ cat bad.js | node
null 103 undefined 8 --- a/good.js
+++ b/bad.js
@@ -10,7 +10,7 @@ function f0(b) {
1 != (2 === [ , 0 ].length)) ]] += (0 | {}) > 2)) !== ((a && (a[(c = 1 + c, (a && (a[b %= a] >>>= !0)) + ((a && (a[(c = 1 + c,
(23..toString() <= "bar") << NaN ^ (3 % {} || -15))] = !1)) < NaN))] = void 0)) !== -4 <= [])),
this.a += (!1 !== !1 - (a && (a.a >>>= 0)) ^ (c += 1, c += 1, /[a2][^e]+$/)) << NaN;
- var bar_1 = (c += 1) + [ (c = 1 + c, /[a2][^e]+$/ * ("function" ^ []) << !0) ].a;
+ c += 1, c = 1 + (c += 1);
a++;
}()));
} OT: off for a nap 💤 |
This seems to be the bare minimum - and it looks like var c = 0;
!function() {
c++;
}(c++ + new function() {
this.NaN = 0;
var bar_1 = (c = c + 1) + (c = 1 + c);
return c++ + bar_1;
}());
console.log(c); |
The regression is pretty recent:
|
Regression introduced in b85a358 |
I think
|
I think any changes to |
There were >1MFuzz in between those releases, mind you 😅 |
Interesting - that commit doesn't look related to the test code. Thanks for the information anyway 👍 |
My apologies and 👍 . |
I think the general phenomema is that |
That makes sense. In fairness, I did not anticipate function cloning when I wrote |
That's why it's so curious that it affects it. You can double check it yourself. |
When a function is deep cloned are variable definition references updated accordingly? |
It's due to The inline suppression is also incorrect, but that would only produce sub-optimal rather than invalid output. |
Only label references are updated at the moment. |
I think |
|
Trying to understand the issue - is a function clone taking place - and the clone is modified - even though the clone is not ultimately used? |
Yup - and the clone went through optimisation separately before being discarded. OT: sorry for the late replies - GitHub notification seems to be malfunctioning for the past couple of days. |
Is this a |
|
The text was updated successfully, but these errors were encountered: