From: Alexey Samsonov Date: Thu, 17 Jan 2013 15:26:47 +0000 (+0000) Subject: ASan: Allow __asan_get_allocated_size(malloc(0)) to be 0 or 1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=708442294e3a37727e6ece6ab62eabe682f80a58;p=platform%2Fupstream%2Fllvm.git ASan: Allow __asan_get_allocated_size(malloc(0)) to be 0 or 1 llvm-svn: 172726 --- diff --git a/compiler-rt/lib/asan/tests/asan_noinst_test.cc b/compiler-rt/lib/asan/tests/asan_noinst_test.cc index 8a7f774..80667ac 100644 --- a/compiler-rt/lib/asan/tests/asan_noinst_test.cc +++ b/compiler-rt/lib/asan/tests/asan_noinst_test.cc @@ -389,7 +389,8 @@ TEST(AddressSanitizerInterface, GetAllocatedSizeAndOwnershipTest) { // 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); }