File tree 1 file changed +14
-0
lines changed
1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 39
39
/* Define a statement-like macro that ignores the arguments. */
40
40
#define SECP256K1_CHECKMEM_NOOP (p , len ) do { (void)(p); (void)(len); } while(0)
41
41
42
+ /* If compiling under msan, map the SECP256K1_CHECKMEM_* functionality to msan.
43
+ * Choose this preferentially, even when VALGRIND is defined, as msan-compiled
44
+ * binaries can't be run under valgrind anyway. */
45
+ #if defined(__has_feature )
46
+ # if __has_feature (memory_sanitizer )
47
+ # include <sanitizer/msan_interface.h>
48
+ # define SECP256K1_CHECKMEM_ENABLED 1
49
+ # define SECP256K1_CHECKMEM_UNDEFINE (p , len ) __msan_allocated_memory((p), (len))
50
+ # define SECP256K1_CHECKMEM_DEFINE (p , len ) __msan_unpoison((p), (len))
51
+ # define SECP256K1_CHECKMEM_CHECK (p , len ) __msan_check_mem_is_initialized((p), (len))
52
+ # define SECP256K1_CHECKMEM_RUNNING () (1)
53
+ # endif
54
+ #endif
55
+
42
56
/* If valgrind integration is desired (through the VALGRIND define), implement the
43
57
* SECP256K1_CHECKMEM_* macros using valgrind. */
44
58
#if !defined SECP256K1_CHECKMEM_ENABLED
You can’t perform that action at this time.
0 commit comments