Skip to content

Commit

Permalink
[vm, compiler] Don't introduce spurious connections to check bounds i…
Browse files Browse the repository at this point in the history
…nstructions during LICM.

TEST=dartfuzz
Bug: #56947
Change-Id: Icf593c246f226dd9d8d8b6b055122f8b567be35e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/391682
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
  • Loading branch information
rmacnak-google authored and pull[bot] committed Nov 12, 2024
1 parent 7338570 commit 6a61e53
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
25 changes: 25 additions & 0 deletions runtime/tests/vm/dart/regress_56947_test.dart
Original file line number Diff line number Diff line change
@@ -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<bool> var79 = <bool>[true, false];
Map<int, bool> var109 = <int, bool>{-74: true, -72: false, 34: true};

main() {
try {
if (var79[-9223372034707292160]) {
switch ((var109[var11[-9223372034707292160]]! ? 100 : 200) <<
(~9223372034707292159)) {}
}
} catch (e, st) {
print("foo throws");
}
}
3 changes: 2 additions & 1 deletion runtime/vm/compiler/backend/flow_graph.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down

0 comments on commit 6a61e53

Please sign in to comment.