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