[llvm-commits] [compiler-rt] r172726 - /compiler-rt/trunk/lib/asan/tests/asan_noinst_test.cc

Alexey Samsonov samsonov at google.com
Thu Jan 17 07:26:47 PST 2013


Author: samsonov
Date: Thu Jan 17 09:26:47 2013
New Revision: 172726

URL: http://llvm.org/viewvc/llvm-project?rev=172726&view=rev
Log:
ASan: Allow __asan_get_allocated_size(malloc(0)) to be 0 or 1

Modified:
    compiler-rt/trunk/lib/asan/tests/asan_noinst_test.cc

Modified: compiler-rt/trunk/lib/asan/tests/asan_noinst_test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/tests/asan_noinst_test.cc?rev=172726&r1=172725&r2=172726&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/tests/asan_noinst_test.cc (original)
+++ compiler-rt/trunk/lib/asan/tests/asan_noinst_test.cc Thu Jan 17 09:26:47 2013
@@ -389,7 +389,8 @@
     // If malloc(0) is not null, this pointer is owned and should have valid
     // allocated size.
     EXPECT_TRUE(__asan_get_ownership(zero_alloc));
-    EXPECT_EQ(0U, __asan_get_allocated_size(zero_alloc));
+    // Allocated size is 0 or 1 depending on the allocator used.
+    EXPECT_LT(__asan_get_allocated_size(zero_alloc), 2);
   }
   free(zero_alloc);
 }





More information about the llvm-commits mailing list