diff options
author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2013-07-05 12:31:07 +0000 |
---|---|---|
committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2013-07-05 12:31:07 +0000 |
commit | 737da2f031badfad5bc5b762cc50d789fbcb6ef8 (patch) | |
tree | 6fbdc38fd21952059e9600cb49648925550d98f9 /lib/msan/msan_interceptors.cc | |
parent | 22d8767a45f08218b4d725146c5a8484a183be29 (diff) | |
download | compiler-rt-737da2f031badfad5bc5b762cc50d789fbcb6ef8.tar.gz compiler-rt-737da2f031badfad5bc5b762cc50d789fbcb6ef8.tar.bz2 compiler-rt-737da2f031badfad5bc5b762cc50d789fbcb6ef8.tar.xz |
[msan] Intercept pthread_key_create.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@185693 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/msan/msan_interceptors.cc')
-rw-r--r-- | lib/msan/msan_interceptors.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/msan/msan_interceptors.cc b/lib/msan/msan_interceptors.cc index 13d10337..aa3342ce 100644 --- a/lib/msan/msan_interceptors.cc +++ b/lib/msan/msan_interceptors.cc @@ -979,6 +979,14 @@ INTERCEPTOR(int, pthread_create, void *th, void *attr, void *(*callback)(void*), return res; } +INTERCEPTOR(int, pthread_key_create, __sanitizer_pthread_key_t *key, void (*dtor) (void *)) { + ENSURE_MSAN_INITED(); + int res = REAL(pthread_key_create)(key, dtor); + if (!res && key) + __msan_unpoison(key, sizeof(*key)); + return res; +} + struct MSanInterceptorContext { bool in_interceptor_scope; }; @@ -1220,6 +1228,7 @@ void InitializeInterceptors() { INTERCEPT_FUNCTION(sigaction); INTERCEPT_FUNCTION(signal); INTERCEPT_FUNCTION(pthread_create); + INTERCEPT_FUNCTION(pthread_key_create); inited = 1; } } // namespace __msan |