From: Philipp Stephani Date: Sat, 1 Aug 2020 14:55:45 +0000 (+0200) Subject: Suppress leak sanitizer in a few more places X-Git-Tag: emacs-28.0.90~6880 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=91d539b0772d4b2a6bdc3fbccf92dc1fcc7f747a;p=emacs.git Suppress leak sanitizer in a few more places * src/regex-emacs.c (regex_compile): src/search.c (newline_cache_on_off): Suppress leak sanitizer. --- diff --git a/src/regex-emacs.c b/src/regex-emacs.c index ba7f3cef64b..5c08c81c0b5 100644 --- a/src/regex-emacs.c +++ b/src/regex-emacs.c @@ -29,6 +29,10 @@ #include +#ifdef HAVE_SANITIZER_LSAN_INTERFACE_H +#include +#endif + #include "character.h" #include "buffer.h" #include "syntax.h" @@ -1757,6 +1761,9 @@ 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 + __lsan_ignore_object (compile_stack.stack); +#endif compile_stack.size = INIT_COMPILE_STACK_SIZE; compile_stack.avail = 0; diff --git a/src/search.c b/src/search.c index ec076c18035..ad5d0302932 100644 --- a/src/search.c +++ b/src/search.c @@ -21,6 +21,10 @@ along with GNU Emacs. If not, see . */ #include +#ifdef HAVE_SANITIZER_LSAN_INTERFACE_H +#include +#endif + #include "lisp.h" #include "character.h" #include "buffer.h" @@ -613,7 +617,12 @@ newline_cache_on_off (struct buffer *buf) { /* It should be on. */ if (base_buf->newline_cache == 0) - base_buf->newline_cache = new_region_cache (); + { + base_buf->newline_cache = new_region_cache (); +#ifdef HAVE_SANITIZER_LSAN_INTERFACE_H + __lsan_ignore_object (base_buf->newline_cache); +#endif + } } return base_buf->newline_cache; }