]> git.eshelyaron.com Git - emacs.git/commitdiff
Suppress leak sanitizer in a few more places
authorPhilipp Stephani <phst@google.com>
Sat, 1 Aug 2020 14:55:45 +0000 (16:55 +0200)
committerPhilipp Stephani <phst@google.com>
Sat, 1 Aug 2020 15:01:00 +0000 (17:01 +0200)
* src/regex-emacs.c (regex_compile):
src/search.c (newline_cache_on_off): Suppress leak sanitizer.

src/regex-emacs.c
src/search.c

index ba7f3cef64b4c87d71f5f7fcded92db572b1e865..5c08c81c0b56072e0d537cb0fa2bb25e12898b0e 100644 (file)
 
 #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;
 
index ec076c18035382b3c5e8f0fbd6eb25c41d912212..ad5d0302932d6cebba92cd42236fbc9b9bff3313 100644 (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;
     }