diff options
author | Alexey Samsonov <vonosmas@gmail.com> | 2014-11-13 22:40:59 +0000 |
---|---|---|
committer | Alexey Samsonov <vonosmas@gmail.com> | 2014-11-13 22:40:59 +0000 |
commit | aa7d23d66380cae9dd4a0f0bd587291fe6a2a3f1 (patch) | |
tree | 4964e19853e0050e5c7498dedd7d36fc7ca91517 /lib/msan | |
parent | b5029d430c3883d516441c7fa6e3cd34aed8370d (diff) |
Fix -Wcast-qual warnings in sanitizers
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221936 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/msan')
-rw-r--r-- | lib/msan/msan.cc | 6 | ||||
-rw-r--r-- | lib/msan/msan_interceptors.cc | 31 | ||||
-rw-r--r-- | lib/msan/msan_interface_internal.h | 4 |
3 files changed, 21 insertions, 20 deletions
diff --git a/lib/msan/msan.cc b/lib/msan/msan.cc index f58ac447b..b2328341e 100644 --- a/lib/msan/msan.cc +++ b/lib/msan/msan.cc @@ -485,7 +485,7 @@ void __msan_check_mem_is_initialized(const void *x, uptr size) { (void)sp; ReportUMRInsideAddressRange(__func__, x, size, offset); __msan::PrintWarningWithOrigin(pc, bp, - __msan_get_origin(((char *)x) + offset)); + __msan_get_origin(((const char *)x) + offset)); if (__msan::flags()->halt_on_error) { Printf("Exiting\n"); Die(); @@ -565,11 +565,11 @@ void __msan_set_origin(const void *a, uptr size, u32 origin) { // 'descr' is created at compile time and contains '----' in the beginning. // When we see descr for the first time we replace '----' with a uniq id // and set the origin to (id | (31-th bit)). -void __msan_set_alloca_origin(void *a, uptr size, const char *descr) { +void __msan_set_alloca_origin(void *a, uptr size, char *descr) { __msan_set_alloca_origin4(a, size, descr, 0); } -void __msan_set_alloca_origin4(void *a, uptr size, const char *descr, uptr pc) { +void __msan_set_alloca_origin4(void *a, uptr size, char *descr, uptr pc) { static const u32 dash = '-'; static const u32 first_timer = dash + (dash << 8) + (dash << 16) + (dash << 24); diff --git a/lib/msan/msan_interceptors.cc b/lib/msan/msan_interceptors.cc index 86c12a48b..1c7a8125a 100644 --- a/lib/msan/msan_interceptors.cc +++ b/lib/msan/msan_interceptors.cc @@ -64,21 +64,22 @@ bool IsInInterceptorScope() { } while (0) // Check that [x, x+n) range is unpoisoned. -#define CHECK_UNPOISONED_0(x, n) \ - do { \ - sptr offset = __msan_test_shadow(x, n); \ - if (__msan::IsInSymbolizer()) break; \ - if (offset >= 0 && __msan::flags()->report_umrs) { \ - GET_CALLER_PC_BP_SP; \ - (void) sp; \ - ReportUMRInsideAddressRange(__func__, x, n, offset); \ - __msan::PrintWarningWithOrigin(pc, bp, \ - __msan_get_origin((char *)x + offset)); \ - if (__msan::flags()->halt_on_error) { \ - Printf("Exiting\n"); \ - Die(); \ - } \ - } \ +#define CHECK_UNPOISONED_0(x, n) \ + do { \ + sptr offset = __msan_test_shadow(x, n); \ + if (__msan::IsInSymbolizer()) \ + break; \ + if (offset >= 0 && __msan::flags()->report_umrs) { \ + GET_CALLER_PC_BP_SP; \ + (void) sp; \ + ReportUMRInsideAddressRange(__func__, x, n, offset); \ + __msan::PrintWarningWithOrigin( \ + pc, bp, __msan_get_origin((const char *)x + offset)); \ + if (__msan::flags()->halt_on_error) { \ + Printf("Exiting\n"); \ + Die(); \ + } \ + } \ } while (0) // Check that [x, x+n) range is unpoisoned unless we are in a nested diff --git a/lib/msan/msan_interface_internal.h b/lib/msan/msan_interface_internal.h index 21bfbc986..401d6f947 100644 --- a/lib/msan/msan_interface_internal.h +++ b/lib/msan/msan_interface_internal.h @@ -88,9 +88,9 @@ void __msan_check_mem_is_initialized(const void *x, uptr size); SANITIZER_INTERFACE_ATTRIBUTE void __msan_set_origin(const void *a, uptr size, u32 origin); SANITIZER_INTERFACE_ATTRIBUTE -void __msan_set_alloca_origin(void *a, uptr size, const char *descr); +void __msan_set_alloca_origin(void *a, uptr size, char *descr); SANITIZER_INTERFACE_ATTRIBUTE -void __msan_set_alloca_origin4(void *a, uptr size, const char *descr, uptr pc); +void __msan_set_alloca_origin4(void *a, uptr size, char *descr, uptr pc); SANITIZER_INTERFACE_ATTRIBUTE u32 __msan_chain_origin(u32 id); SANITIZER_INTERFACE_ATTRIBUTE |