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

Unified Diff: syzygy/integration_tests/asan_interceptors_tests.h

Issue 2983783002: Run the integration tests against the Clang instrumented DLL. (Closed)
Patch Set: Address Chris comment. 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..8e058fcd7036f2d6af7d0c25e63135b265747730 100644
--- a/syzygy/integration_tests/asan_interceptors_tests.h
+++ b/syzygy/integration_tests/asan_interceptors_tests.h
@@ -31,7 +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) {
+ return *location;
+}
+#else
type NonInterceptedRead(type* location) {
// The try-except statement prevents the function from being instrumented.
__try {
@@ -41,6 +46,7 @@ type NonInterceptedRead(type* location) {
}
return static_cast<type>(0);
}
+#endif
// Helper function to do non instrumented reads from an array.
// @tparam type The type of the values to be read.
@@ -58,7 +64,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 +79,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