[dart2js] Avoid discarding type tests during SSA with

--experiment-null-safety-checks

Change-Id: If3e2465103494d4772b1f8b71e7c57ae83b3e036
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332371
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
This commit is contained in:
Mayank Patke 2023-10-30 22:08:47 +00:00 committed by Commit Queue
parent 9615958211
commit b034a909a6

View file

@ -4343,6 +4343,10 @@ AbstractBool _typeTest(
JClosedWorld closedWorld,
CompilerOptions options,
{required bool isCast}) {
// The null safety mode may affect the result of a type test, so defer to
// runtime.
if (options.experimentNullSafetyChecks) return AbstractBool.Maybe;
JCommonElements commonElements = closedWorld.commonElements;
DartTypes dartTypes = closedWorld.dartTypes;
AbstractValueDomain abstractValueDomain = closedWorld.abstractValueDomain;