Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add support for ASAN instrumentation
- Loading branch information
Showing
1 changed file
with
8 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,13 @@ | |
# define MEM_NOACCESS(a,len) VALGRIND_MAKE_MEM_NOACCESS(a,len) | ||
# define MEM_CHECK_ADDRESSABLE(a,len) VALGRIND_CHECK_MEM_IS_ADDRESSABLE(a,len) | ||
# define MEM_CHECK_DEFINED(a,len) VALGRIND_CHECK_MEM_IS_DEFINED(a,len) | ||
#else /* HAVE_VALGRIND */ | ||
#elif defined(__SANITIZE_ADDRESS__) | ||
# include <sanitizer/asan_interface.h> | ||
# define MEM_UNDEFINED(a,len) ASAN_UNPOISON_MEMORY_REGION(a,len) | ||
# define MEM_NOACCESS(a,len) ASAN_POISON_MEMORY_REGION(a,len) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong. |
||
# define MEM_CHECK_ADDRESSABLE(a,len) ((void) 0) | ||
# define MEM_CHECK_DEFINED(a,len) ((void) 0) | ||
#else | ||
# define MEM_UNDEFINED(a,len) ((void) 0) | ||
# define MEM_NOACCESS(a,len) ((void) 0) | ||
# define MEM_CHECK_ADDRESSABLE(a,len) ((void) 0) | ||
|
@@ -35,9 +41,8 @@ | |
#ifndef DBUG_OFF | ||
#define TRASH_FILL(A,B,C) do { memset(A, C, B); MEM_UNDEFINED(A, B); } while (0) | ||
This comment has been minimized.
Sorry, something went wrong.
kevgs
Contributor
|
||
#else | ||
#define TRASH_FILL(A,B,C) do{ MEM_CHECK_ADDRESSABLE(A,B);MEM_UNDEFINED(A,B);} while (0) | ||
#define TRASH_FILL(A,B,C) do { MEM_CHECK_ADDRESSABLE(A,B);MEM_UNDEFINED(A,B);} while (0) | ||
#endif | ||
#define TRASH_ALLOC(A,B) TRASH_FILL(A,B,0xA5) | ||
#define TRASH_FREE(A,B) TRASH_FILL(A,B,0x8F) | ||
#define TRASH(A,B) TRASH_FREE(A,B) | ||
|
This looks like a dead code: I didn't find macro usage with
grep
.