[CP] Fix for issue #59901 #59924
Labels
area-dart2wasm
Issues for the dart2wasm compiler.
cherry-pick-review
Issue that need cherry pick triage to approve
triage-automation
See https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot.
type-bug
Incorrect behavior (everything from a crash to more subtle misbehavior)
Commit(s) to merge
Target
beta
Prepared changelist for beta/stable
(Is this necessary? https://github.com/dart-lang/sdk/blob/main/docs/Cherry-picks-to-a-release-channel.md says changelog is only necessary for CPs into stable)
Issue Description
In code like
if (x == <string constant>) { ... use x ... }
TFA normally propagates the information thatx
equals to the string constant when processing the body of the conditional.However unlike in VM, in dart2wasm,
x
being equal to a string constant or literal does not meanx
and the literal or constant have the same class.Assuming this causes miscompilation, which manifests itself as a runtime crash.
What is the fix
Don't assume that, in dart2wasm, a variable being equal to a string means the variable and string have the same class.
Why cherry-pick
Blocks user migrating from
dart:html
topackage:web
.Risk
None
Issue link(s)
#59901
The text was updated successfully, but these errors were encountered: