diff --git a/runtime/tests/vm/dart/regress_56948_test.dart b/runtime/tests/vm/dart/regress_56948_test.dart new file mode 100644 index 000000000000..39b484bb1559 --- /dev/null +++ b/runtime/tests/vm/dart/regress_56948_test.dart @@ -0,0 +1,26 @@ +// 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 2618914219 --no-fp --no-ffi --flat +// @dart=2.14 + +import 'dart:typed_data'; +import 'dart:io'; + +@pragma("vm:never-inline") +foo() { + Int8List(28).fillRange(-19, 25, 9223372034707292160); +} + +main() { + try { + foo(); + } catch (e, st) { + print('foo throws'); + } + + sleep(Duration(seconds: 3)); // Let background compiler catch up. +} diff --git a/runtime/vm/compiler/backend/il_arm.cc b/runtime/vm/compiler/backend/il_arm.cc index 7cb7243d4a1e..15e54c980192 100644 --- a/runtime/vm/compiler/backend/il_arm.cc +++ b/runtime/vm/compiler/backend/il_arm.cc @@ -2384,7 +2384,7 @@ LocationSummary* StoreIndexedInstr::MakeLocationSummary(Zone* zone, locs->set_in(2, Location::Pair(Location::RequiresRegister(), Location::RequiresRegister())); } else if (rep == kUnboxedInt8 || rep == kUnboxedUint8) { - locs->set_in(2, LocationRegisterOrConstant(value())); + locs->set_in(2, LocationRegisterOrSmiConstant(value())); } else { locs->set_in(2, Location::RequiresRegister()); }