From 708442294e3a37727e6ece6ab62eabe682f80a58 Mon Sep 17 00:00:00 2001 From: Alexey Samsonov Date: Thu, 17 Jan 2013 15:26:47 +0000 Subject: [PATCH] ASan: Allow __asan_get_allocated_size(malloc(0)) to be 0 or 1 llvm-svn: 172726 --- compiler-rt/lib/asan/tests/asan_noinst_test.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); } -- 2.7.4