OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright 2016 Google Inc. |
| 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. |
| 6 */ |
| 7 |
| 8 #ifndef SkMSAN_DEFINED |
| 9 #define SkMSAN_DEFINED |
| 10 |
| 11 #include <stddef.h> // size_t |
| 12 |
| 13 // Typically declared in LLVM's msan_interface.h. Easier for us to just re-decl
are. |
| 14 extern "C" { |
| 15 void __msan_check_mem_is_initialized(const volatile void*, size_t); |
| 16 } |
| 17 |
| 18 // Code that requires initialized inputs can call this to make it clear that |
| 19 // the blame for use of uninitialized data belongs further up the call stack. |
| 20 static inline void sk_msan_assert_initialized(const void* begin, const void* end
) { |
| 21 #if defined(__has_feature) |
| 22 #if __has_feature(memory_sanitizer) |
| 23 __msan_check_mem_is_initialized(begin, (const char*)end - (const char*)b
egin); |
| 24 #endif |
| 25 #endif |
| 26 } |
| 27 |
| 28 #endif//SkMSAN_DEFINED |
OLD | NEW |