Files
sdk/runtime
Tess Strickland 727eaf1a0f [vm/compiler] Fix type propagation for Redefinitions.
In addition to the underlying type (stored as either a cid or an
AbstractType), CompileTypes also store two flags: whether a value of the
type can be null and whether it can be a sentinel.

When constraining the type of a definition via a RedefinitionInstr, the
resulting type should be nullable only if both the original and
constrained type are. Similarly, the resulting type should only allow
the sentinel value if both the original and constrained type do.

When the underlying type is represented by a cid, this was already
the case. When it is represented by an AbstractType, only nullability
was appropriately handled. This CL fixes it so that the possibility of
being a sentinel is also handled correctly in the latter case.

TEST=vm/cc/TypePropagator_RedefineCanBeSentinelWithCannotBe

Bug: https://github.com/dart-lang/sdk/issues/47739
Change-Id: I9d51b1c14ff385d522309f9c984a25dc6bdfbbf4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220767
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2021-11-19 16:35:27 +00:00
..
2021-08-11 01:14:22 +00:00