Chromium Code Reviews| 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. |