[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 06310cf 3/3: Use a more precise check for '__lsan_ignore_object'
From: |
Philipp Stephani |
Subject: |
master 06310cf 3/3: Use a more precise check for '__lsan_ignore_object' |
Date: |
Sat, 1 Aug 2020 11:14:44 -0400 (EDT) |
branch: master
commit 06310cf9122500faa96ad200888cfbb1dda56563
Author: Philipp Stephani <phst@google.com>
Commit: Philipp Stephani <phst@google.com>
Use a more precise check for '__lsan_ignore_object'
* configure.ac: Add check for __lsan_ignore_object.
* src/buffer.c (enlarge_buffer_text):
* src/data.c (make_blv):
* src/emacs-module.c (Fmodule_load, initialize_environment):
* src/regex-emacs.c (regex_compile):
* src/search.c (newline_cache_on_off): Use new configuration macro.
---
configure.ac | 2 +-
src/buffer.c | 2 +-
src/data.c | 2 +-
src/emacs-module.c | 4 ++--
src/regex-emacs.c | 2 +-
src/search.c | 2 +-
6 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/configure.ac b/configure.ac
index b4674e3..93463e3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4516,7 +4516,7 @@ AC_CHECK_FUNCS_ONCE([sbrk])
AC_FUNC_FORK
-AC_CHECK_FUNCS(snprintf)
+AC_CHECK_FUNCS(snprintf __lsan_ignore_object)
dnl Check for glib. This differs from other library checks in that
dnl Emacs need not link to glib unless some other library is already
diff --git a/src/buffer.c b/src/buffer.c
index 3456a46..e441499 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -5087,7 +5087,7 @@ enlarge_buffer_text (struct buffer *b, ptrdiff_t delta)
#else
p = xrealloc (b->text->beg, new_nbytes);
#endif
-#ifdef HAVE_SANITIZER_LSAN_INTERFACE_H
+#ifdef HAVE___LSAN_IGNORE_OBJECT
__lsan_ignore_object (p);
#endif
diff --git a/src/data.c b/src/data.c
index c261e8e..5fff52d 100644
--- a/src/data.c
+++ b/src/data.c
@@ -1788,7 +1788,7 @@ make_blv (struct Lisp_Symbol *sym, bool forwarded,
set_blv_defcell (blv, tem);
set_blv_valcell (blv, tem);
set_blv_found (blv, false);
-#ifdef HAVE_SANITIZER_LSAN_INTERFACE_H
+#ifdef HAVE___LSAN_IGNORE_OBJECT
__lsan_ignore_object (blv);
#endif
return blv;
diff --git a/src/emacs-module.c b/src/emacs-module.c
index 4374bf4..f571019 100644
--- a/src/emacs-module.c
+++ b/src/emacs-module.c
@@ -1103,7 +1103,7 @@ DEFUN ("module-load", Fmodule_load, Smodule_load, 1, 1, 0,
if (module_assertions)
{
rt = xmalloc (sizeof *rt);
-#ifdef HAVE_SANITIZER_LSAN_INTERFACE_H
+#ifdef HAVE___LSAN_IGNORE_OBJECT
__lsan_ignore_object (rt);
#endif
}
@@ -1426,7 +1426,7 @@ initialize_environment (emacs_env *env, struct
emacs_env_private *priv)
if (module_assertions)
{
env = xmalloc (sizeof *env);
-#ifdef HAVE_SANITIZER_LSAN_INTERFACE_H
+#ifdef HAVE___LSAN_IGNORE_OBJECT
__lsan_ignore_object (env);
#endif
}
diff --git a/src/regex-emacs.c b/src/regex-emacs.c
index 5c08c81..1ecbc74 100644
--- a/src/regex-emacs.c
+++ b/src/regex-emacs.c
@@ -1761,7 +1761,7 @@ regex_compile (re_char *pattern, ptrdiff_t size,
/* Initialize the compile stack. */
compile_stack.stack = xmalloc (INIT_COMPILE_STACK_SIZE
* sizeof *compile_stack.stack);
-#ifdef HAVE_SANITIZER_LSAN_INTERFACE_H
+#ifdef HAVE___LSAN_IGNORE_OBJECT
__lsan_ignore_object (compile_stack.stack);
#endif
compile_stack.size = INIT_COMPILE_STACK_SIZE;
diff --git a/src/search.c b/src/search.c
index ad5d030..7b74ff9 100644
--- a/src/search.c
+++ b/src/search.c
@@ -619,7 +619,7 @@ newline_cache_on_off (struct buffer *buf)
if (base_buf->newline_cache == 0)
{
base_buf->newline_cache = new_region_cache ();
-#ifdef HAVE_SANITIZER_LSAN_INTERFACE_H
+#ifdef HAVE___LSAN_IGNORE_OBJECT
__lsan_ignore_object (base_buf->newline_cache);
#endif
}