The clang implementation of asan has __attribute__((no_address_safety_analysis)): (http://clang.llvm.org/docs/AddressSanitizer.html#no_address_safety_analysis) ==== Some code should not be instrumented by AddressSanitizer. One may use the function attribute no_address_safety_analysis to disable instrumentation of a particular function. This attribute may not be supported by other compilers, so we suggest to use it together with __has_feature(address_sanitizer). Note: currently, this attribute will be lost if the function is inlined. ==== The gcc implementation needs a similar attribute (preferably, with the same syntax and semantics) One example where this attribute is used: V8 stack profiler which touches random bytes on the stack.
Author: jakub Date: Fri Nov 23 09:02:28 2012 New Revision: 193748 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=193748 Log: PR sanitizer/55435 * c-common.c (handle_no_address_safety_analysis_attribute): New function. (c_common_attribute_table): Add no_address_safety_analysis. * asan.c (gate_asan): Don't instrument functions with no_address_safety_analysis attribute. (gate_asan_O0): Use !optimize && gate_asan (). * doc/extend.texi (no_address_safety_analysis): Document new function attribute. * c-c++-common/asan/attrib-1.c: New test. Added: trunk/gcc/testsuite/c-c++-common/asan/attrib-1.c Modified: trunk/gcc/ChangeLog trunk/gcc/asan.c trunk/gcc/c-family/ChangeLog trunk/gcc/c-family/c-common.c trunk/gcc/doc/extend.texi trunk/gcc/testsuite/ChangeLog
Fixed.