summaryrefslogtreecommitdiff
path: root/lib/tsan/rtl/tsan_mman.h
diff options
context:
space:
mode:
authorAlexey Samsonov <vonosmas@gmail.com>2014-07-01 18:01:20 +0000
committerAlexey Samsonov <vonosmas@gmail.com>2014-07-01 18:01:20 +0000
commit5ed1ca723a900b0fd7ce1ae3d18f71267c75629c (patch)
tree8db56d378c1dccf1d410a71d8c2bbdb7ebc7934c /lib/tsan/rtl/tsan_mman.h
parent255b8163f56950d936207a38b0a8b50a72504dc1 (diff)
[TSan] Equalize the behavior of __tsan_get_allocated_size and user_alloc_usable_size.
The former used to crash with a null deref if it was given a not owned pointer, while the latter returned 0. Now they both return 0. This is still not the best possible behavior: it is better to print an error report with a stack trace, pointing to the error in user code, as we do in ASan. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@212112 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/tsan/rtl/tsan_mman.h')
-rw-r--r--lib/tsan/rtl/tsan_mman.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/tsan/rtl/tsan_mman.h b/lib/tsan/rtl/tsan_mman.h
index 67c6ee5ea..7b4f9bd7c 100644
--- a/lib/tsan/rtl/tsan_mman.h
+++ b/lib/tsan/rtl/tsan_mman.h
@@ -31,7 +31,7 @@ void *user_alloc(ThreadState *thr, uptr pc, uptr sz,
void user_free(ThreadState *thr, uptr pc, void *p);
void *user_realloc(ThreadState *thr, uptr pc, void *p, uptr sz);
void *user_alloc_aligned(ThreadState *thr, uptr pc, uptr sz, uptr align);
-uptr user_alloc_usable_size(ThreadState *thr, uptr pc, void *p);
+uptr user_alloc_usable_size(void *p);
// Invoking malloc/free hooks that may be installed by the user.
void invoke_malloc_hook(void *ptr, uptr size);