-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
improper DCE after seemingly-unrelated change #3555
Labels
Comments
leeoniya
added a commit
to leeoniya/uPlot
that referenced
this issue
May 13, 2020
some minor movement of assignments works around this issue: leeoniya/uPlot@abacd02#diff-0e94ed30087b62b2ab95466722c48f84 |
To repro most projects just diff the bundle generated by:
vs
Then remove code from the first bundle until the test case is reduced...
Expected:
Actual:
|
This bug also affects other mutable Array methods.
Expected:
Actual:
Possible fix: --- a/src/ast/values.ts
+++ b/src/ast/values.ts
@@ -106,7 +106,7 @@ export class UnknownArrayExpression implements ExpressionEntity {
context: HasEffectsContext
) {
if (path.length === 1) {
- return hasMemberEffectWhenCalled(arrayMembers, path[0], this.included, callOptions, context);
+ return hasMemberEffectWhenCalled(arrayMembers, path[0], true, callOptions, context);
}
return true;
}
@@ -323,7 +323,7 @@ export class UnknownObjectExpression implements ExpressionEntity {
context: HasEffectsContext
) {
if (path.length === 1) {
- return hasMemberEffectWhenCalled(objectMembers, path[0], this.included, callOptions, context);
+ return hasMemberEffectWhenCalled(objectMembers, path[0], true, callOptions, context);
}
return true;
} With fix:
|
9 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@lukastaegert
the relevant changes are minimal (just the uPlot.js file): leeoniya/uPlot@625f600#diff-0e94ed30087b62b2ab95466722c48f84
I have not been able to get a minimal repro in the REPL :(, so hopefully the provided commit is sufficient.
Expected Behavior
instances of
series.splice()
are retained in the bundle, since they continue to operate on reachable variables both before and after the linked commit.Actual Behavior
instances of
series.splice()
are now purged from the bundle:leeoniya/uPlot@625f600#diff-deb943c7f48de2a8aecf97812918454aL1114-L1127
hopefully something simple (or my mistake).
thanks!
The text was updated successfully, but these errors were encountered: