fix corner case in reduce_vars (#4031)

fixes #4030
This commit is contained in:
Alex Lam S.L
2020-07-31 01:05:09 +01:00
committed by GitHub
parent dfe47bcc42
commit ee632a5519
2 changed files with 27 additions and 1 deletions

View File

@@ -587,7 +587,10 @@ merge(Compressor.prototype, {
d.assignments++;
var fixed = d.fixed;
var value = eq ? node.right : node;
if (is_modified(compressor, tw, node, value, 0)) return;
if (is_modified(compressor, tw, node, value, 0)) {
d.fixed = false;
return;
}
var safe = eq || safe_to_read(tw, d);
node.right.walk(tw);
if (safe && safe_to_assign(tw, d)) {