From: Philipp Stephani Date: Sat, 1 Aug 2020 15:12:30 +0000 (+0200) Subject: Use a more precise check for '__lsan_ignore_object' X-Git-Tag: emacs-28.0.90~6878 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=06310cf9122500faa96ad200888cfbb1dda56563;p=emacs.git 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. --- diff --git a/configure.ac b/configure.ac index b4674e3204b..93463e344ab 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 3456a46be3e..e441499aeb0 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 c261e8e90dd..5fff52d24c2 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 4374bf4b1c4..f57101946b3 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 5c08c81c0b5..1ecbc74b96c 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 ad5d0302932..7b74ff91480 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 }