diff --git a/runtime/tests/vm/dart/regress_56947_test.dart b/runtime/tests/vm/dart/regress_56947_test.dart new file mode 100644 index 000000000000..75b9b5cc72d2 --- /dev/null +++ b/runtime/tests/vm/dart/regress_56947_test.dart @@ -0,0 +1,25 @@ +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +// The Dart Project Fuzz Tester (1.101). +// Program generated as: +// dart dartfuzz.dart --seed 466727405 --no-fp --no-ffi --flat +// @dart=2.14 + +import 'dart:typed_data'; + +Int16List var11 = Int16List(33); +List var79 = [true, false]; +Map var109 = {-74: true, -72: false, 34: true}; + +main() { + try { + if (var79[-9223372034707292160]) { + switch ((var109[var11[-9223372034707292160]]! ? 100 : 200) << + (~9223372034707292159)) {} + } + } catch (e, st) { + print("foo throws"); + } +} diff --git a/runtime/vm/compiler/backend/flow_graph.cc b/runtime/vm/compiler/backend/flow_graph.cc index 5a7b15d9f307..ea4e2bcce2b2 100644 --- a/runtime/vm/compiler/backend/flow_graph.cc +++ b/runtime/vm/compiler/backend/flow_graph.cc @@ -2678,7 +2678,8 @@ void FlowGraph::RenameUsesDominatedByRedefinitions() { Definition* definition = instr_it.Current()->AsDefinition(); // CheckArrayBound instructions have their own mechanism for ensuring // proper dependencies, so we don't rewrite those here. - if (definition != nullptr && !definition->IsCheckArrayBound()) { + if (definition != nullptr && !definition->IsCheckArrayBound() && + !definition->IsGenericCheckBound()) { Value* redefined = definition->RedefinedValue(); if (redefined != nullptr) { if (!definition->HasSSATemp()) {