Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Unified Diff: syzygy/integration_tests/asan_interceptors_tests.h

Issue 2983783002: Run the integration tests against the Clang instrumented DLL. (Closed)
Patch Set: remove dead code. Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | syzygy/integration_tests/asan_interceptors_tests.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: syzygy/integration_tests/asan_interceptors_tests.h
diff --git a/syzygy/integration_tests/asan_interceptors_tests.h b/syzygy/integration_tests/asan_interceptors_tests.h
index 9f26cbf571119aaa648adf67171667cf51daadff..2e9b13ff3200663e7ee1b5142b9e8ea11d1751bb 100644
--- a/syzygy/integration_tests/asan_interceptors_tests.h
+++ b/syzygy/integration_tests/asan_interceptors_tests.h
@@ -31,8 +31,12 @@ namespace testing {
// @tparam type The type of the value to be read.
// @param location The location where to read from.
// @returns the value at |location|
-template<typename type>
+template <typename type>
+#if defined(__clang__)
+type __attribute__((no_sanitize_address)) NonInterceptedRead(type* location) {
+#else
type NonInterceptedRead(type* location) {
+#endif
// The try-except statement prevents the function from being instrumented.
__try {
return *location;
chrisha 2017/08/30 16:55:32 You don't need the try/except for the Clang versio
@@ -58,7 +62,13 @@ void NonInterceptedReads(type* src, size_t size, type* dst) {
// @tparam type The type of the value to be written.
// @param location The location where to write to.
// @param val The value to write.
-template<typename type>
+template <typename type>
+#if defined(__clang__)
+void __attribute__((no_sanitize_address))
+NonInterceptedWrite(type* location, type val) {
+ *location = val;
+}
+#else
void NonInterceptedWrite(type* location, type val) {
// The try-except statement prevents the function from being instrumented.
__try {
@@ -67,6 +77,7 @@ void NonInterceptedWrite(type* location, type val) {
// Nothing to do here.
}
}
+#endif
// Helper function to do non instrumented writes from an array.
// @tparam type The type of the values to be written.
« no previous file with comments | « no previous file | syzygy/integration_tests/asan_interceptors_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698