summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2012-07-11 01:14:27 -0500
committerJohn Wiegley <johnw@newartisans.com>2012-07-11 01:14:27 -0500
commitb41253a389afdffde3d2551e4c165f0ebbafdf89 (patch)
tree772126439a523aa0e2d961a232d7e25a3aae5e92
parentd923b542aa2d115bb87e72e156be837cea752536 (diff)
downloademacs-b41253a389afdffde3d2551e4c165f0ebbafdf89.tar.gz
alloc.c (mark_memory): Guard the "no_address_safety_analysis" function
attribute, so we only use it if it exists in the compiler.
-rw-r--r--src/ChangeLog6
-rw-r--r--src/alloc.c4
2 files changed, 9 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 8a6dc8644b8..64a7989a70f 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
+2012-07-11 John Wiegley <johnw@newartisans.com>
+
+ * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
+ function attribute, so we only use it if it exists in the
+ compiler.
+
2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
Avoid call to strlen in fast_c_string_match_ignore_case.
diff --git a/src/alloc.c b/src/alloc.c
index 89f2c5dbed1..ac200254b8c 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -4641,12 +4641,14 @@ mark_maybe_pointer (void *p)
static void
mark_memory (void *start, void *end)
-#ifdef __clang__
+#if defined (__clang__) && defined (__has_feature)
+#if __has_feature(address_sanitizer)
/* Do not allow -faddress-sanitizer to check this function, since it
crosses the function stack boundary, and thus would yield many
false positives. */
__attribute__((no_address_safety_analysis))
#endif
+#endif
{
void **pp;
int i;