1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-07 04:10:27 -08:00

Suppress leak sanitizer in a few more places

* src/regex-emacs.c (regex_compile):
src/search.c (newline_cache_on_off): Suppress leak sanitizer.
This commit is contained in:
Philipp Stephani 2020-08-01 16:55:45 +02:00
parent 4ea90a711d
commit 91d539b077
2 changed files with 17 additions and 1 deletions

View file

@ -29,6 +29,10 @@
#include <stdlib.h>
#ifdef HAVE_SANITIZER_LSAN_INTERFACE_H
#include <sanitizer/lsan_interface.h>
#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;

View file

@ -21,6 +21,10 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
#include <config.h>
#ifdef HAVE_SANITIZER_LSAN_INTERFACE_H
#include <sanitizer/lsan_interface.h>
#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;
}