fix corner case in collapse_vars (#4909)

fixes #4908
This commit is contained in:
Alex Lam S.L
2021-05-04 09:33:52 +01:00
committed by GitHub
parent ce3c35fa8b
commit 3094eaaa89
3 changed files with 28 additions and 3 deletions

View File

@@ -1911,6 +1911,7 @@ merge(Compressor.prototype, {
right: ref,
});
}
ref.fixed = false;
def.replaced++;
return ref;
}
@@ -1991,6 +1992,7 @@ merge(Compressor.prototype, {
&& !compressor.exposed(def);
value_def.last_ref = false;
value_def.single_use = false;
CHANGED = true;
}
if (replaced && !remove_candidate(candidate)) statements.splice(stat_index, 1);
}