summaryrefslogtreecommitdiff
path: root/include/my_valgrind.h
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2018-01-20 12:50:28 +0100
committerSergei Golubchik <serg@mariadb.org>2018-01-22 11:39:54 +0100
commita966d422ca56d1772b9f975a8ef48442ae528f0a (patch)
treea94f7e5a256b3860834cc15f15da627741303644 /include/my_valgrind.h
parent22ae3843db6c8b2a84ca5d16cd99025abb52cc27 (diff)
downloadmariadb-git-a966d422ca56d1772b9f975a8ef48442ae528f0a.tar.gz
improve ASAN instrumentation: TRASH
mark freed memory as not accessible, not merely undefined
Diffstat (limited to 'include/my_valgrind.h')
-rw-r--r--include/my_valgrind.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/my_valgrind.h b/include/my_valgrind.h
index 6fcc4dfa54a..9baed2e01d6 100644
--- a/include/my_valgrind.h
+++ b/include/my_valgrind.h
@@ -39,9 +39,9 @@
#endif /* HAVE_VALGRIND */
#ifndef DBUG_OFF
-#define TRASH_FILL(A,B,C) do { memset(A, C, B); MEM_UNDEFINED(A, B); } while (0)
+#define TRASH_FILL(A,B,C) do { MEM_UNDEFINED(A,B); memset(A,C,B); } while(0)
#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_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_ALLOC(A,B) do { TRASH_FILL(A,B,0xA5); MEM_UNDEFINED(A,B); } while(0)
+#define TRASH_FREE(A,B) do { TRASH_FILL(A,B,0x8F); MEM_NOACCESS(A,B); } while(0)