diff options
| author | Alexey Samsonov <samsonov@google.com> | 2012-01-17 13:31:54 +0000 |
|---|---|---|
| committer | Alexey Samsonov <samsonov@google.com> | 2012-01-17 13:31:54 +0000 |
| commit | 1e310295d02bbf5f95ad7e8a2e5dcbe92e231bf6 (patch) | |
| tree | f1b24f27703aee51bc8331eeaf3c861128794be4 /compiler-rt/lib/asan/tests/asan_test.cc | |
| parent | 2b2e0721d722a4639f3d3761c8add419090ae465 (diff) | |
| download | bcm5719-llvm-1e310295d02bbf5f95ad7e8a2e5dcbe92e231bf6.tar.gz bcm5719-llvm-1e310295d02bbf5f95ad7e8a2e5dcbe92e231bf6.zip | |
AddressSanitizer: from this patch, ASan allocator returns false for __asan_get_ownership(NULL) and produce error reports for malloc_usable_size(NULL) and __asan_get_allocated_size(NULL)
llvm-svn: 148304
Diffstat (limited to 'compiler-rt/lib/asan/tests/asan_test.cc')
| -rw-r--r-- | compiler-rt/lib/asan/tests/asan_test.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler-rt/lib/asan/tests/asan_test.cc b/compiler-rt/lib/asan/tests/asan_test.cc index 363bb893e98..ca4aab6fd71 100644 --- a/compiler-rt/lib/asan/tests/asan_test.cc +++ b/compiler-rt/lib/asan/tests/asan_test.cc @@ -528,9 +528,9 @@ TEST(AddressSanitizer, MallocUsableSizeTest) { const size_t kArraySize = 100; char *array = Ident((char*)malloc(kArraySize)); int *int_ptr = Ident(new int); - EXPECT_EQ(0, malloc_usable_size(NULL)); EXPECT_EQ(kArraySize, malloc_usable_size(array)); EXPECT_EQ(sizeof(int), malloc_usable_size(int_ptr)); + EXPECT_DEATH(malloc_usable_size(NULL), kMallocUsableSizeErrorMsg); EXPECT_DEATH(malloc_usable_size((void*)0x123), kMallocUsableSizeErrorMsg); EXPECT_DEATH(malloc_usable_size(array + kArraySize / 2), kMallocUsableSizeErrorMsg); |

