-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[dart2js] Don't rely on
== null
promoting to Null in rti.dart.
Although the true branch of `x != null` and the false branch of `x == null` promote `x` to non-nullable, the opposing branches do not promote `x` to `Null` in the current flow analysis spec, which applies to the CFE. When switching from the dart2js static type computation to the CFE static type computation, attempting to use `x` in these branches may generate an unintended type check, which can overflow the stack if this occurs in code responsible for performing type checks. The fix is fairly straightforward - we can simply use an unchecked cast (via `JS`) instead. See dart-lang/language#1505 for discussion on why the expected promotion does not (yet) occur. Change-Id: Ia9cca4e1aa8e9c67b42c60189f0d3811afb61360 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289061 Reviewed-by: Stephen Adams <sra@google.com>
- Loading branch information
1 parent
6f45c85
commit 62e3c47
Showing
1 changed file
with
12 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters