Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(228)

Side by Side Diff: webrtc/base/sanitizer.h

Issue 2318083002: VadCore: Allow signed multiplication overflow that we don't know how to fix (Closed)
Patch Set: Handle compilers that define __clang__ but don't have the no_sanitize attribute Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | webrtc/common_audio/vad/vad_core.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2016 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2016 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 15 matching lines...) Expand all
26 #define RTC_HAS_MSAN 0 26 #define RTC_HAS_MSAN 0
27 #endif 27 #endif
28 28
29 #if RTC_HAS_ASAN 29 #if RTC_HAS_ASAN
30 #include <sanitizer/asan_interface.h> 30 #include <sanitizer/asan_interface.h>
31 #endif 31 #endif
32 #if RTC_HAS_MSAN 32 #if RTC_HAS_MSAN
33 #include <sanitizer/msan_interface.h> 33 #include <sanitizer/msan_interface.h>
34 #endif 34 #endif
35 35
36 #ifdef __has_attribute
37 #if __has_attribute(no_sanitize)
38 #define RTC_NO_SANITIZE(what) __attribute__((no_sanitize(what)))
39 #endif
40 #endif
41 #ifndef RTC_NO_SANITIZE
42 #define RTC_NO_SANITIZE(what)
43 #endif
44
36 // Ask ASan to mark the memory range [ptr, ptr + element_size * num_elements) 45 // Ask ASan to mark the memory range [ptr, ptr + element_size * num_elements)
37 // as being unaddressable, so that reads and writes are not allowed. ASan may 46 // as being unaddressable, so that reads and writes are not allowed. ASan may
38 // narrow the range to the nearest alignment boundaries. 47 // narrow the range to the nearest alignment boundaries.
39 static inline void rtc_AsanPoison(const volatile void* ptr, 48 static inline void rtc_AsanPoison(const volatile void* ptr,
40 size_t element_size, 49 size_t element_size,
41 size_t num_elements) { 50 size_t num_elements) {
42 #if RTC_HAS_ASAN 51 #if RTC_HAS_ASAN
43 ASAN_POISON_MEMORY_REGION(ptr, element_size * num_elements); 52 ASAN_POISON_MEMORY_REGION(ptr, element_size * num_elements);
44 #endif 53 #endif
45 } 54 }
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 template <typename T> 107 template <typename T>
99 inline void MsanCheckInitialized(const T& mem) { 108 inline void MsanCheckInitialized(const T& mem) {
100 rtc_MsanCheckInitialized(mem.data(), sizeof(mem.data()[0]), mem.size()); 109 rtc_MsanCheckInitialized(mem.data(), sizeof(mem.data()[0]), mem.size());
101 } 110 }
102 111
103 } // namespace rtc 112 } // namespace rtc
104 113
105 #endif // __cplusplus 114 #endif // __cplusplus
106 115
107 #endif // WEBRTC_BASE_SANITIZER_H_ 116 #endif // WEBRTC_BASE_SANITIZER_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/common_audio/vad/vad_core.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698