[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 91d539b 1/3: Suppress leak sanitizer in a few more places
From: |
Philipp Stephani |
Subject: |
master 91d539b 1/3: Suppress leak sanitizer in a few more places |
Date: |
Sat, 1 Aug 2020 11:14:43 -0400 (EDT) |
branch: master
commit 91d539b0772d4b2a6bdc3fbccf92dc1fcc7f747a
Author: Philipp Stephani <phst@google.com>
Commit: Philipp Stephani <phst@google.com>
Suppress leak sanitizer in a few more places
* src/regex-emacs.c (regex_compile):
src/search.c (newline_cache_on_off): Suppress leak sanitizer.
---
src/regex-emacs.c | 7 +++++++
src/search.c | 11 ++++++++++-
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/src/regex-emacs.c b/src/regex-emacs.c
index ba7f3ce..5c08c81 100644
--- a/src/regex-emacs.c
+++ b/src/regex-emacs.c
@@ -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;
diff --git a/src/search.c b/src/search.c
index ec076c1..ad5d030 100644
--- a/src/search.c
+++ b/src/search.c
@@ -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;
}