Files
sdk/tests
Ömer Sinan Ağacan 25169313d9 [dart2wasm] Avoid compiler crash when casting unboxed types
When omitting checks, casts between unboxed types currently cause a
compile-time crash when generating the conversion.

This compile-time crash is useful to catch compiler errors, but when the
checks are omitted it can be triggered on invalid casts, such as when
casting a `double` to `int`.

So when omitting checks, generate an `unreachable` (consistent with
other type cast failure when omitting checks) instead of crashing.

An alterantive implementation (see patchset 1) would be checking for
cast failures when compiling `as` expressions with omitted checks.
However it makes the code slightly more complicated, and more
importantly `unreachable` gets a wrong source span as it's generated
after the `wrap` to compile expression.

Fixes #56234.

Change-Id: Ia93a850d028a69320ff671efd8344843fa7c4388
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/375640
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-07-15 11:27:32 +00:00
..

This directory contains tests of the language and core library implementations. For more information, see https://github.com/dart-lang/sdk/tree/main/docs/Testing.md.