Skip to content

Commit 99bd9d7

Browse files
askeksacommit-bot@chromium.org
authored andcommitted
[vm, gardening] Initialize target array in movs tests to satisfy msan.
Fixes #42289 Change-Id: I13630b44d0c5bf5ec51256fb1fac41f812dd3e7e Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150984 Auto-Submit: Aske Simon Christensen <[email protected]> Commit-Queue: Martin Kustermann <[email protected]> Reviewed-by: Martin Kustermann <[email protected]>
1 parent e160698 commit 99bd9d7

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

runtime/vm/compiler/assembler/assembler_ia32_test.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4756,7 +4756,7 @@ ASSEMBLER_TEST_GENERATE(TestRepMovsBytes, assembler) {
47564756

47574757
ASSEMBLER_TEST_RUN(TestRepMovsBytes, test) {
47584758
const char* from = "0123456789x";
4759-
char* to = new char[11];
4759+
char* to = new char[11]{0};
47604760
to[10] = 'y';
47614761
typedef void (*TestRepMovsBytes)(const char* from, char* to, int count);
47624762
reinterpret_cast<TestRepMovsBytes>(test->entry())(from, to, 10);
@@ -4798,7 +4798,7 @@ ASSEMBLER_TEST_GENERATE(TestRepMovsWords, assembler) {
47984798
ASSEMBLER_TEST_RUN(TestRepMovsWords, test) {
47994799
const uint16_t from[11] = {0x0123, 0x1234, 0x2345, 0x3456, 0x4567, 0x5678,
48004800
0x6789, 0x789A, 0x89AB, 0x9ABC, 0xABCD};
4801-
uint16_t* to = new uint16_t[11];
4801+
uint16_t* to = new uint16_t[11]{0};
48024802
to[10] = 0xFEFE;
48034803
typedef void (*TestRepMovsWords)(const uint16_t* from, uint16_t* to,
48044804
int count);
@@ -4842,7 +4842,7 @@ ASSEMBLER_TEST_RUN(TestRepMovsDwords, test) {
48424842
const uint32_t from[11] = {0x01234567, 0x12345678, 0x23456789, 0x3456789A,
48434843
0x456789AB, 0x56789ABC, 0x6789ABCD, 0x789ABCDE,
48444844
0x89ABCDEF, 0x9ABCDEF0, 0xABCDEF01};
4845-
uint32_t* to = new uint32_t[11];
4845+
uint32_t* to = new uint32_t[11]{0};
48464846
to[10] = 0xFEFEFEFE;
48474847
typedef void (*TestRepMovsDwords)(const uint32_t* from, uint32_t* to,
48484848
int count);

runtime/vm/compiler/assembler/assembler_x64_test.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5557,7 +5557,7 @@ ASSEMBLER_TEST_GENERATE(TestRepMovsBytes, assembler) {
55575557

55585558
ASSEMBLER_TEST_RUN(TestRepMovsBytes, test) {
55595559
const char* from = "0123456789x";
5560-
char* to = new char[11];
5560+
char* to = new char[11]{0};
55615561
to[10] = 'y';
55625562
typedef void (*TestRepMovsBytes)(const char* from, char* to, int count);
55635563
reinterpret_cast<TestRepMovsBytes>(test->entry())(from, to, 10);
@@ -5607,7 +5607,7 @@ ASSEMBLER_TEST_GENERATE(TestRepMovsWords, assembler) {
56075607
ASSEMBLER_TEST_RUN(TestRepMovsWords, test) {
56085608
const uint16_t from[11] = {0x0123, 0x1234, 0x2345, 0x3456, 0x4567, 0x5678,
56095609
0x6789, 0x789A, 0x89AB, 0x9ABC, 0xABCD};
5610-
uint16_t* to = new uint16_t[11];
5610+
uint16_t* to = new uint16_t[11]{0};
56115611
to[10] = 0xFEFE;
56125612
typedef void (*TestRepMovsWords)(const uint16_t* from, uint16_t* to,
56135613
int count);
@@ -5659,7 +5659,7 @@ ASSEMBLER_TEST_RUN(TestRepMovsDwords, test) {
56595659
const uint32_t from[11] = {0x01234567, 0x12345678, 0x23456789, 0x3456789A,
56605660
0x456789AB, 0x56789ABC, 0x6789ABCD, 0x789ABCDE,
56615661
0x89ABCDEF, 0x9ABCDEF0, 0xABCDEF01};
5662-
uint32_t* to = new uint32_t[11];
5662+
uint32_t* to = new uint32_t[11]{0};
56635663
to[10] = 0xFEFEFEFE;
56645664
typedef void (*TestRepMovsDwords)(const uint32_t* from, uint32_t* to,
56655665
int count);
@@ -5713,7 +5713,7 @@ ASSEMBLER_TEST_RUN(TestRepMovsQwords, test) {
57135713
0x3456789ABCDEF012, 0x456789ABCDEF0123, 0x56789ABCDEF01234,
57145714
0x6789ABCDEF012345, 0x789ABCDEF0123456, 0x89ABCDEF01234567,
57155715
0x9ABCDEF012345678, 0xABCDEF0123456789};
5716-
uint64_t* to = new uint64_t[11];
5716+
uint64_t* to = new uint64_t[11]{0};
57175717
to[10] = 0xFEFEFEFEFEFEFEFE;
57185718
typedef void (*TestRepMovsQwords)(const uint64_t* from, uint64_t* to,
57195719
int count);

0 commit comments

Comments
 (0)