delete => delete[] for arrays.
authorRichard Trieu <rtrieu@google.com>
Wed, 12 Nov 2014 04:19:57 +0000 (04:19 +0000)
committerRichard Trieu <rtrieu@google.com>
Wed, 12 Nov 2014 04:19:57 +0000 (04:19 +0000)
llvm-svn: 221769

compiler-rt/lib/asan/tests/asan_test.cc
compiler-rt/lib/msan/tests/msan_test.cc

index 91a7356..67bcbac 100644 (file)
@@ -832,7 +832,7 @@ NOINLINE static int LargeFunction(bool do_bad_access) {
   x[18]++;
   x[19]++;
 
-  delete x;
+  delete[] x;
   return res;
 }
 
index 2266cdd..c91fb0d 100644 (file)
@@ -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;
 }