diff --git a/compiler-rt/lib/asan/tests/asan_test.cc b/compiler-rt/lib/asan/tests/asan_test.cc index 91a735696a22..67bcbaca1e40 100644 --- a/compiler-rt/lib/asan/tests/asan_test.cc +++ b/compiler-rt/lib/asan/tests/asan_test.cc @@ -832,7 +832,7 @@ NOINLINE static int LargeFunction(bool do_bad_access) { x[18]++; x[19]++; - delete x; + delete[] x; return res; } diff --git a/compiler-rt/lib/msan/tests/msan_test.cc b/compiler-rt/lib/msan/tests/msan_test.cc index 2266cdd02494..c91fb0d4bb68 100644 --- a/compiler-rt/lib/msan/tests/msan_test.cc +++ b/compiler-rt/lib/msan/tests/msan_test.cc @@ -570,7 +570,7 @@ TEST(MemorySanitizer, fread) { EXPECT_NOT_POISONED(x[16]); EXPECT_NOT_POISONED(x[31]); fclose(f); - delete x; + delete[] x; } TEST(MemorySanitizer, read) { @@ -583,7 +583,7 @@ TEST(MemorySanitizer, read) { EXPECT_NOT_POISONED(x[16]); EXPECT_NOT_POISONED(x[31]); close(fd); - delete x; + delete[] x; } TEST(MemorySanitizer, pread) { @@ -596,7 +596,7 @@ TEST(MemorySanitizer, pread) { EXPECT_NOT_POISONED(x[16]); EXPECT_NOT_POISONED(x[31]); close(fd); - delete x; + delete[] x; } TEST(MemorySanitizer, readv) { @@ -2807,7 +2807,7 @@ TEST(MemorySanitizer, scanf) { EXPECT_NOT_POISONED(s[4]); EXPECT_NOT_POISONED(s[5]); EXPECT_POISONED(s[6]); - delete s; + delete[] s; delete d; }