diff options
| author | Andrea Corallo | 2020-08-02 17:36:29 +0200 |
|---|---|---|
| committer | Andrea Corallo | 2020-08-02 17:36:29 +0200 |
| commit | e5095f0fd31764a729b4afebf8b5e868a09eef28 (patch) | |
| tree | 9404b95851af889d2f3652db786bca6180394587 /src | |
| parent | 7a161dc688f0eeee64e307a55efbc7d11bab3627 (diff) | |
| parent | 99d1a66646b7450ad0be3e4471341b50fee7bdb5 (diff) | |
| download | emacs-e5095f0fd31764a729b4afebf8b5e868a09eef28.tar.gz emacs-e5095f0fd31764a729b4afebf8b5e868a09eef28.zip | |
Merge remote-tracking branch 'savannah/master' into HEAD
Diffstat (limited to 'src')
| -rw-r--r-- | src/Makefile.in | 4 | ||||
| -rw-r--r-- | src/alloc.c | 47 | ||||
| -rw-r--r-- | src/buffer.c | 7 | ||||
| -rw-r--r-- | src/composite.c | 19 | ||||
| -rw-r--r-- | src/data.c | 7 | ||||
| -rw-r--r-- | src/dispextern.h | 2 | ||||
| -rw-r--r-- | src/emacs-module.c | 28 | ||||
| -rw-r--r-- | src/fileio.c | 6 | ||||
| -rw-r--r-- | src/indent.c | 4 | ||||
| -rw-r--r-- | src/lisp.h | 19 | ||||
| -rw-r--r-- | src/nsterm.m | 3 | ||||
| -rw-r--r-- | src/pdumper.c | 3 | ||||
| -rw-r--r-- | src/regex-emacs.c | 7 | ||||
| -rw-r--r-- | src/search.c | 11 | ||||
| -rw-r--r-- | src/xdisp.c | 2 | ||||
| -rw-r--r-- | src/xfaces.c | 5 |
16 files changed, 123 insertions, 51 deletions
diff --git a/src/Makefile.in b/src/Makefile.in index 2f373d3eb7f..3cc9d594144 100644 --- a/src/Makefile.in +++ b/src/Makefile.in | |||
| @@ -323,7 +323,7 @@ INTERVALS_H = dispextern.h intervals.h composite.h | |||
| 323 | 323 | ||
| 324 | GETLOADAVG_LIBS = @GETLOADAVG_LIBS@ | 324 | GETLOADAVG_LIBS = @GETLOADAVG_LIBS@ |
| 325 | 325 | ||
| 326 | LIB_GMP = @LIB_GMP@ | 326 | LIBGMP = @LIBGMP@ |
| 327 | 327 | ||
| 328 | LIBGCCJIT = @LIBGCCJIT_LIB@ | 328 | LIBGCCJIT = @LIBGCCJIT_LIB@ |
| 329 | 329 | ||
| @@ -535,7 +535,7 @@ LIBES = $(LIBS) $(W32_LIBS) $(LIBS_GNUSTEP) $(LIBX_BASE) $(LIBIMAGE) \ | |||
| 535 | $(FREETYPE_LIBS) $(FONTCONFIG_LIBS) $(HARFBUZZ_LIBS) $(LIBOTF_LIBS) $(M17N_FLT_LIBS) \ | 535 | $(FREETYPE_LIBS) $(FONTCONFIG_LIBS) $(HARFBUZZ_LIBS) $(LIBOTF_LIBS) $(M17N_FLT_LIBS) \ |
| 536 | $(LIBGNUTLS_LIBS) $(LIB_PTHREAD) $(GETADDRINFO_A_LIBS) $(LCMS2_LIBS) \ | 536 | $(LIBGNUTLS_LIBS) $(LIB_PTHREAD) $(GETADDRINFO_A_LIBS) $(LCMS2_LIBS) \ |
| 537 | $(NOTIFY_LIBS) $(LIB_MATH) $(LIBZ) $(LIBMODULES) $(LIBSYSTEMD_LIBS) \ | 537 | $(NOTIFY_LIBS) $(LIB_MATH) $(LIBZ) $(LIBMODULES) $(LIBSYSTEMD_LIBS) \ |
| 538 | $(JSON_LIBS) $(LIB_GMP) $(LIBGCCJIT) | 538 | $(JSON_LIBS) $(LIBGMP) $(LIBGCCJIT) |
| 539 | 539 | ||
| 540 | ## FORCE it so that admin/unidata can decide whether this file is | 540 | ## FORCE it so that admin/unidata can decide whether this file is |
| 541 | ## up-to-date. Although since charprop depends on bootstrap-emacs, | 541 | ## up-to-date. Although since charprop depends on bootstrap-emacs, |
diff --git a/src/alloc.c b/src/alloc.c index a31b4a045e2..12f53bdd6d8 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -1947,6 +1947,9 @@ resize_string_data (Lisp_Object string, ptrdiff_t cidx_byte, | |||
| 1947 | /* No need to reallocate, as the size change falls within the | 1947 | /* No need to reallocate, as the size change falls within the |
| 1948 | alignment slop. */ | 1948 | alignment slop. */ |
| 1949 | XSTRING (string)->u.s.size_byte = new_nbytes; | 1949 | XSTRING (string)->u.s.size_byte = new_nbytes; |
| 1950 | #ifdef GC_CHECK_STRING_BYTES | ||
| 1951 | SDATA_NBYTES (old_sdata) = new_nbytes; | ||
| 1952 | #endif | ||
| 1950 | new_charaddr = data + cidx_byte; | 1953 | new_charaddr = data + cidx_byte; |
| 1951 | memmove (new_charaddr + new_clen, new_charaddr + clen, | 1954 | memmove (new_charaddr + new_clen, new_charaddr + clen, |
| 1952 | nbytes - (cidx_byte + (clen - 1))); | 1955 | nbytes - (cidx_byte + (clen - 1))); |
| @@ -4658,7 +4661,16 @@ mark_maybe_object (Lisp_Object obj) | |||
| 4658 | break; | 4661 | break; |
| 4659 | } | 4662 | } |
| 4660 | 4663 | ||
| 4661 | void *po = (char *) XLP (obj) + (offset - LISP_WORD_TAG (type_tag)); | 4664 | bool overflow |
| 4665 | = INT_SUBTRACT_WRAPV (offset, LISP_WORD_TAG (type_tag), &offset); | ||
| 4666 | #if !defined WIDE_EMACS_INT || USE_LSB_TAG | ||
| 4667 | /* If we don't use wide integers, then `intptr_t' should always be | ||
| 4668 | large enough to not overflow. Furthermore, when using the least | ||
| 4669 | significant bits as tag bits, the tag is small enough to not | ||
| 4670 | overflow either. */ | ||
| 4671 | eassert (!overflow); | ||
| 4672 | #endif | ||
| 4673 | void *po = (char *) ((intptr_t) (char *) XLP (obj) + offset); | ||
| 4662 | 4674 | ||
| 4663 | /* If the pointer is in the dump image and the dump has a record | 4675 | /* If the pointer is in the dump image and the dump has a record |
| 4664 | of the object starting at the place where the pointer points, we | 4676 | of the object starting at the place where the pointer points, we |
| @@ -4869,7 +4881,7 @@ mark_memory (void const *start, void const *end) | |||
| 4869 | On a host with 32-bit pointers and 64-bit Lisp_Objects, | 4881 | On a host with 32-bit pointers and 64-bit Lisp_Objects, |
| 4870 | a Lisp_Object might be split into registers saved into | 4882 | a Lisp_Object might be split into registers saved into |
| 4871 | non-adjacent words and P might be the low-order word's value. */ | 4883 | non-adjacent words and P might be the low-order word's value. */ |
| 4872 | p += (intptr_t) lispsym; | 4884 | p = (char *) ((uintptr_t) p + (uintptr_t) lispsym); |
| 4873 | mark_maybe_pointer (p); | 4885 | mark_maybe_pointer (p); |
| 4874 | 4886 | ||
| 4875 | verify (alignof (Lisp_Object) % GC_POINTER_ALIGNMENT == 0); | 4887 | verify (alignof (Lisp_Object) % GC_POINTER_ALIGNMENT == 0); |
| @@ -4986,27 +4998,6 @@ typedef union | |||
| 4986 | #endif | 4998 | #endif |
| 4987 | } stacktop_sentry; | 4999 | } stacktop_sentry; |
| 4988 | 5000 | ||
| 4989 | /* Force callee-saved registers and register windows onto the stack. | ||
| 4990 | Use the platform-defined __builtin_unwind_init if available, | ||
| 4991 | obviating the need for machine dependent methods. */ | ||
| 4992 | #ifndef HAVE___BUILTIN_UNWIND_INIT | ||
| 4993 | # ifdef __sparc__ | ||
| 4994 | /* This trick flushes the register windows so that all the state of | ||
| 4995 | the process is contained in the stack. | ||
| 4996 | FreeBSD does not have a ta 3 handler, so handle it specially. | ||
| 4997 | FIXME: Code in the Boehm GC suggests flushing (with 'flushrs') is | ||
| 4998 | needed on ia64 too. See mach_dep.c, where it also says inline | ||
| 4999 | assembler doesn't work with relevant proprietary compilers. */ | ||
| 5000 | # if defined __sparc64__ && defined __FreeBSD__ | ||
| 5001 | # define __builtin_unwind_init() asm ("flushw") | ||
| 5002 | # else | ||
| 5003 | # define __builtin_unwind_init() asm ("ta 3") | ||
| 5004 | # endif | ||
| 5005 | # else | ||
| 5006 | # define __builtin_unwind_init() ((void) 0) | ||
| 5007 | # endif | ||
| 5008 | #endif | ||
| 5009 | |||
| 5010 | /* Yield an address close enough to the top of the stack that the | 5001 | /* Yield an address close enough to the top of the stack that the |
| 5011 | garbage collector need not scan above it. Callers should be | 5002 | garbage collector need not scan above it. Callers should be |
| 5012 | declared NO_INLINE. */ | 5003 | declared NO_INLINE. */ |
| @@ -5042,16 +5033,14 @@ typedef union | |||
| 5042 | We have to mark Lisp objects in CPU registers that can hold local | 5033 | We have to mark Lisp objects in CPU registers that can hold local |
| 5043 | variables or are used to pass parameters. | 5034 | variables or are used to pass parameters. |
| 5044 | 5035 | ||
| 5045 | This code assumes that calling setjmp saves registers we need | 5036 | If __builtin_unwind_init is available, it should suffice to save |
| 5037 | registers. | ||
| 5038 | |||
| 5039 | Otherwise, assume that calling setjmp saves registers we need | ||
| 5046 | to see in a jmp_buf which itself lies on the stack. This doesn't | 5040 | to see in a jmp_buf which itself lies on the stack. This doesn't |
| 5047 | have to be true! It must be verified for each system, possibly | 5041 | have to be true! It must be verified for each system, possibly |
| 5048 | by taking a look at the source code of setjmp. | 5042 | by taking a look at the source code of setjmp. |
| 5049 | 5043 | ||
| 5050 | If __builtin_unwind_init is available (defined by GCC >= 2.8) we | ||
| 5051 | can use it as a machine independent method to store all registers | ||
| 5052 | to the stack. In this case the macros described in the previous | ||
| 5053 | two paragraphs are not used. | ||
| 5054 | |||
| 5055 | Stack Layout | 5044 | Stack Layout |
| 5056 | 5045 | ||
| 5057 | Architectures differ in the way their processor stack is organized. | 5046 | Architectures differ in the way their processor stack is organized. |
diff --git a/src/buffer.c b/src/buffer.c index f1cb4d50414..e441499aeb0 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -28,6 +28,10 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ | |||
| 28 | #include <stdlib.h> | 28 | #include <stdlib.h> |
| 29 | #include <unistd.h> | 29 | #include <unistd.h> |
| 30 | 30 | ||
| 31 | #ifdef HAVE_SANITIZER_LSAN_INTERFACE_H | ||
| 32 | #include <sanitizer/lsan_interface.h> | ||
| 33 | #endif | ||
| 34 | |||
| 31 | #include <verify.h> | 35 | #include <verify.h> |
| 32 | 36 | ||
| 33 | #include "lisp.h" | 37 | #include "lisp.h" |
| @@ -5083,6 +5087,9 @@ enlarge_buffer_text (struct buffer *b, ptrdiff_t delta) | |||
| 5083 | #else | 5087 | #else |
| 5084 | p = xrealloc (b->text->beg, new_nbytes); | 5088 | p = xrealloc (b->text->beg, new_nbytes); |
| 5085 | #endif | 5089 | #endif |
| 5090 | #ifdef HAVE___LSAN_IGNORE_OBJECT | ||
| 5091 | __lsan_ignore_object (p); | ||
| 5092 | #endif | ||
| 5086 | 5093 | ||
| 5087 | if (p == NULL) | 5094 | if (p == NULL) |
| 5088 | { | 5095 | { |
diff --git a/src/composite.c b/src/composite.c index 2c589e4f3a9..f96f0b77726 100644 --- a/src/composite.c +++ b/src/composite.c | |||
| @@ -1167,7 +1167,9 @@ composition_compute_stop_pos (struct composition_it *cmp_it, ptrdiff_t charpos, | |||
| 1167 | character to check, and CHARPOS and BYTEPOS are indices in the | 1167 | character to check, and CHARPOS and BYTEPOS are indices in the |
| 1168 | string. In that case, FACE must not be NULL. BIDI_LEVEL is the bidi | 1168 | string. In that case, FACE must not be NULL. BIDI_LEVEL is the bidi |
| 1169 | embedding level of the current paragraph, and is used to calculate the | 1169 | embedding level of the current paragraph, and is used to calculate the |
| 1170 | direction argument to pass to the font shaper. | 1170 | direction argument to pass to the font shaper; value of -1 means the |
| 1171 | caller doesn't know the embedding level (used by callers which didn't | ||
| 1172 | invoke the display routines that perform bidi-display-reordering). | ||
| 1171 | 1173 | ||
| 1172 | If the character is composed, setup members of CMP_IT (id, nglyphs, | 1174 | If the character is composed, setup members of CMP_IT (id, nglyphs, |
| 1173 | from, to, reversed_p), and return true. Otherwise, update | 1175 | from, to, reversed_p), and return true. Otherwise, update |
| @@ -1213,7 +1215,9 @@ composition_reseat_it (struct composition_it *cmp_it, ptrdiff_t charpos, | |||
| 1213 | continue; | 1215 | continue; |
| 1214 | if (charpos < endpos) | 1216 | if (charpos < endpos) |
| 1215 | { | 1217 | { |
| 1216 | if ((bidi_level & 1) == 0) | 1218 | if (bidi_level < 0) |
| 1219 | direction = Qnil; | ||
| 1220 | else if ((bidi_level & 1) == 0) | ||
| 1217 | direction = QL2R; | 1221 | direction = QL2R; |
| 1218 | else | 1222 | else |
| 1219 | direction = QR2L; | 1223 | direction = QR2L; |
| @@ -1250,7 +1254,16 @@ composition_reseat_it (struct composition_it *cmp_it, ptrdiff_t charpos, | |||
| 1250 | else | 1254 | else |
| 1251 | bpos = CHAR_TO_BYTE (cpos); | 1255 | bpos = CHAR_TO_BYTE (cpos); |
| 1252 | } | 1256 | } |
| 1253 | if ((bidi_level & 1) == 0) | 1257 | /* The bidi_level < 0 case below strictly speaking should |
| 1258 | never happen, since we get here when bidi scan direction | ||
| 1259 | is backward in the buffer, which can only happen if the | ||
| 1260 | display routines were called to perform the bidi | ||
| 1261 | reordering. But it doesn't harm to test for that, and | ||
| 1262 | avoid someon raising their brows and thinking it's a | ||
| 1263 | subtle bug... */ | ||
| 1264 | if (bidi_level < 0) | ||
| 1265 | direction = Qnil; | ||
| 1266 | else if ((bidi_level & 1) == 0) | ||
| 1254 | direction = QL2R; | 1267 | direction = QL2R; |
| 1255 | else | 1268 | else |
| 1256 | direction = QR2L; | 1269 | direction = QR2L; |
diff --git a/src/data.c b/src/data.c index 3088487c60c..e827695d295 100644 --- a/src/data.c +++ b/src/data.c | |||
| @@ -23,6 +23,10 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ | |||
| 23 | #include <math.h> | 23 | #include <math.h> |
| 24 | #include <stdio.h> | 24 | #include <stdio.h> |
| 25 | 25 | ||
| 26 | #ifdef HAVE_SANITIZER_LSAN_INTERFACE_H | ||
| 27 | #include <sanitizer/lsan_interface.h> | ||
| 28 | #endif | ||
| 29 | |||
| 26 | #include <byteswap.h> | 30 | #include <byteswap.h> |
| 27 | #include <count-one-bits.h> | 31 | #include <count-one-bits.h> |
| 28 | #include <count-trailing-zeros.h> | 32 | #include <count-trailing-zeros.h> |
| @@ -1830,6 +1834,9 @@ make_blv (struct Lisp_Symbol *sym, bool forwarded, | |||
| 1830 | set_blv_defcell (blv, tem); | 1834 | set_blv_defcell (blv, tem); |
| 1831 | set_blv_valcell (blv, tem); | 1835 | set_blv_valcell (blv, tem); |
| 1832 | set_blv_found (blv, false); | 1836 | set_blv_found (blv, false); |
| 1837 | #ifdef HAVE___LSAN_IGNORE_OBJECT | ||
| 1838 | __lsan_ignore_object (blv); | ||
| 1839 | #endif | ||
| 1833 | return blv; | 1840 | return blv; |
| 1834 | } | 1841 | } |
| 1835 | 1842 | ||
diff --git a/src/dispextern.h b/src/dispextern.h index e1d6eddc419..311867a0c8c 100644 --- a/src/dispextern.h +++ b/src/dispextern.h | |||
| @@ -3538,7 +3538,7 @@ void recompute_basic_faces (struct frame *); | |||
| 3538 | int face_at_buffer_position (struct window *, ptrdiff_t, ptrdiff_t *, | 3538 | int face_at_buffer_position (struct window *, ptrdiff_t, ptrdiff_t *, |
| 3539 | ptrdiff_t, bool, int, enum lface_attribute_index); | 3539 | ptrdiff_t, bool, int, enum lface_attribute_index); |
| 3540 | int face_for_overlay_string (struct window *, ptrdiff_t, ptrdiff_t *, ptrdiff_t, | 3540 | int face_for_overlay_string (struct window *, ptrdiff_t, ptrdiff_t *, ptrdiff_t, |
| 3541 | bool, Lisp_Object); | 3541 | bool, Lisp_Object, enum lface_attribute_index); |
| 3542 | int face_at_string_position (struct window *, Lisp_Object, ptrdiff_t, ptrdiff_t, | 3542 | int face_at_string_position (struct window *, Lisp_Object, ptrdiff_t, ptrdiff_t, |
| 3543 | ptrdiff_t *, enum face_id, bool, | 3543 | ptrdiff_t *, enum face_id, bool, |
| 3544 | enum lface_attribute_index); | 3544 | enum lface_attribute_index); |
diff --git a/src/emacs-module.c b/src/emacs-module.c index e4e7da088d7..f57101946b3 100644 --- a/src/emacs-module.c +++ b/src/emacs-module.c | |||
| @@ -84,6 +84,10 @@ To add a new module function, proceed as follows: | |||
| 84 | #include <stdlib.h> | 84 | #include <stdlib.h> |
| 85 | #include <time.h> | 85 | #include <time.h> |
| 86 | 86 | ||
| 87 | #ifdef HAVE_SANITIZER_LSAN_INTERFACE_H | ||
| 88 | #include <sanitizer/lsan_interface.h> | ||
| 89 | #endif | ||
| 90 | |||
| 87 | #include "lisp.h" | 91 | #include "lisp.h" |
| 88 | #include "bignum.h" | 92 | #include "bignum.h" |
| 89 | #include "dynlib.h" | 93 | #include "dynlib.h" |
| @@ -190,7 +194,7 @@ struct emacs_runtime_private | |||
| 190 | /* Forward declarations. */ | 194 | /* Forward declarations. */ |
| 191 | 195 | ||
| 192 | static Lisp_Object value_to_lisp (emacs_value); | 196 | static Lisp_Object value_to_lisp (emacs_value); |
| 193 | static emacs_value allocate_emacs_value (emacs_env *, struct emacs_value_storage *, Lisp_Object); | 197 | static emacs_value allocate_emacs_value (emacs_env *, Lisp_Object); |
| 194 | static emacs_value lisp_to_value (emacs_env *, Lisp_Object); | 198 | static emacs_value lisp_to_value (emacs_env *, Lisp_Object); |
| 195 | static enum emacs_funcall_exit module_non_local_exit_check (emacs_env *); | 199 | static enum emacs_funcall_exit module_non_local_exit_check (emacs_env *); |
| 196 | static void module_assert_thread (void); | 200 | static void module_assert_thread (void); |
| @@ -1095,7 +1099,16 @@ DEFUN ("module-load", Fmodule_load, Smodule_load, 1, 1, 0, | |||
| 1095 | for two different runtime objects are guaranteed to be distinct, | 1099 | for two different runtime objects are guaranteed to be distinct, |
| 1096 | which we can use for checking the liveness of runtime | 1100 | which we can use for checking the liveness of runtime |
| 1097 | pointers. */ | 1101 | pointers. */ |
| 1098 | struct emacs_runtime *rt = module_assertions ? xmalloc (sizeof *rt) : &rt_pub; | 1102 | struct emacs_runtime *rt; |
| 1103 | if (module_assertions) | ||
| 1104 | { | ||
| 1105 | rt = xmalloc (sizeof *rt); | ||
| 1106 | #ifdef HAVE___LSAN_IGNORE_OBJECT | ||
| 1107 | __lsan_ignore_object (rt); | ||
| 1108 | #endif | ||
| 1109 | } | ||
| 1110 | else | ||
| 1111 | rt = &rt_pub; | ||
| 1099 | rt->size = sizeof *rt; | 1112 | rt->size = sizeof *rt; |
| 1100 | rt->private_members = &rt_priv; | 1113 | rt->private_members = &rt_priv; |
| 1101 | rt->get_environment = module_get_environment; | 1114 | rt->get_environment = module_get_environment; |
| @@ -1321,7 +1334,7 @@ lisp_to_value (emacs_env *env, Lisp_Object o) | |||
| 1321 | struct emacs_env_private *p = env->private_members; | 1334 | struct emacs_env_private *p = env->private_members; |
| 1322 | if (p->pending_non_local_exit != emacs_funcall_exit_return) | 1335 | if (p->pending_non_local_exit != emacs_funcall_exit_return) |
| 1323 | return NULL; | 1336 | return NULL; |
| 1324 | return allocate_emacs_value (env, &p->storage, o); | 1337 | return allocate_emacs_value (env, o); |
| 1325 | } | 1338 | } |
| 1326 | 1339 | ||
| 1327 | /* Must be called for each frame before it can be used for allocation. */ | 1340 | /* Must be called for each frame before it can be used for allocation. */ |
| @@ -1358,9 +1371,9 @@ finalize_storage (struct emacs_value_storage *storage) | |||
| 1358 | /* Allocate a new value from STORAGE and stores OBJ in it. Return | 1371 | /* Allocate a new value from STORAGE and stores OBJ in it. Return |
| 1359 | NULL if allocation fails and use ENV for non local exit reporting. */ | 1372 | NULL if allocation fails and use ENV for non local exit reporting. */ |
| 1360 | static emacs_value | 1373 | static emacs_value |
| 1361 | allocate_emacs_value (emacs_env *env, struct emacs_value_storage *storage, | 1374 | allocate_emacs_value (emacs_env *env, Lisp_Object obj) |
| 1362 | Lisp_Object obj) | ||
| 1363 | { | 1375 | { |
| 1376 | struct emacs_value_storage *storage = &env->private_members->storage; | ||
| 1364 | eassert (storage->current); | 1377 | eassert (storage->current); |
| 1365 | eassert (storage->current->offset < value_frame_size); | 1378 | eassert (storage->current->offset < value_frame_size); |
| 1366 | eassert (! storage->current->next); | 1379 | eassert (! storage->current->next); |
| @@ -1411,7 +1424,12 @@ static emacs_env * | |||
| 1411 | initialize_environment (emacs_env *env, struct emacs_env_private *priv) | 1424 | initialize_environment (emacs_env *env, struct emacs_env_private *priv) |
| 1412 | { | 1425 | { |
| 1413 | if (module_assertions) | 1426 | if (module_assertions) |
| 1427 | { | ||
| 1414 | env = xmalloc (sizeof *env); | 1428 | env = xmalloc (sizeof *env); |
| 1429 | #ifdef HAVE___LSAN_IGNORE_OBJECT | ||
| 1430 | __lsan_ignore_object (env); | ||
| 1431 | #endif | ||
| 1432 | } | ||
| 1415 | 1433 | ||
| 1416 | priv->pending_non_local_exit = emacs_funcall_exit_return; | 1434 | priv->pending_non_local_exit = emacs_funcall_exit_return; |
| 1417 | initialize_storage (&priv->storage); | 1435 | initialize_storage (&priv->storage); |
diff --git a/src/fileio.c b/src/fileio.c index 2f1d2f82433..37072d9b6bd 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -2031,7 +2031,7 @@ permissions. */) | |||
| 2031 | ptrdiff_t count = SPECPDL_INDEX (); | 2031 | ptrdiff_t count = SPECPDL_INDEX (); |
| 2032 | Lisp_Object encoded_file, encoded_newname; | 2032 | Lisp_Object encoded_file, encoded_newname; |
| 2033 | #if HAVE_LIBSELINUX | 2033 | #if HAVE_LIBSELINUX |
| 2034 | security_context_t con; | 2034 | char *con; |
| 2035 | int conlength = 0; | 2035 | int conlength = 0; |
| 2036 | #endif | 2036 | #endif |
| 2037 | #ifdef WINDOWSNT | 2037 | #ifdef WINDOWSNT |
| @@ -3118,7 +3118,7 @@ or if SELinux is disabled, or if Emacs lacks SELinux support. */) | |||
| 3118 | #if HAVE_LIBSELINUX | 3118 | #if HAVE_LIBSELINUX |
| 3119 | if (is_selinux_enabled ()) | 3119 | if (is_selinux_enabled ()) |
| 3120 | { | 3120 | { |
| 3121 | security_context_t con; | 3121 | char *con; |
| 3122 | int conlength = lgetfilecon (SSDATA (ENCODE_FILE (absname)), &con); | 3122 | int conlength = lgetfilecon (SSDATA (ENCODE_FILE (absname)), &con); |
| 3123 | if (conlength > 0) | 3123 | if (conlength > 0) |
| 3124 | { | 3124 | { |
| @@ -3163,7 +3163,7 @@ or if Emacs was not compiled with SELinux support. */) | |||
| 3163 | Lisp_Object role = CAR_SAFE (CDR_SAFE (context)); | 3163 | Lisp_Object role = CAR_SAFE (CDR_SAFE (context)); |
| 3164 | Lisp_Object type = CAR_SAFE (CDR_SAFE (CDR_SAFE (context))); | 3164 | Lisp_Object type = CAR_SAFE (CDR_SAFE (CDR_SAFE (context))); |
| 3165 | Lisp_Object range = CAR_SAFE (CDR_SAFE (CDR_SAFE (CDR_SAFE (context)))); | 3165 | Lisp_Object range = CAR_SAFE (CDR_SAFE (CDR_SAFE (CDR_SAFE (context)))); |
| 3166 | security_context_t con; | 3166 | char *con; |
| 3167 | bool fail; | 3167 | bool fail; |
| 3168 | int conlength; | 3168 | int conlength; |
| 3169 | context_t parsed_con; | 3169 | context_t parsed_con; |
diff --git a/src/indent.c b/src/indent.c index c0b4c13b2c5..581323b91ee 100644 --- a/src/indent.c +++ b/src/indent.c | |||
| @@ -596,7 +596,7 @@ scan_for_column (ptrdiff_t *endpos, EMACS_INT *goalcol, ptrdiff_t *prevcol) | |||
| 596 | if (cmp_it.id >= 0 | 596 | if (cmp_it.id >= 0 |
| 597 | || (scan == cmp_it.stop_pos | 597 | || (scan == cmp_it.stop_pos |
| 598 | && composition_reseat_it (&cmp_it, scan, scan_byte, end, | 598 | && composition_reseat_it (&cmp_it, scan, scan_byte, end, |
| 599 | w, NEUTRAL_DIR, NULL, Qnil))) | 599 | w, -1, NULL, Qnil))) |
| 600 | composition_update_it (&cmp_it, scan, scan_byte, Qnil); | 600 | composition_update_it (&cmp_it, scan, scan_byte, Qnil); |
| 601 | if (cmp_it.id >= 0) | 601 | if (cmp_it.id >= 0) |
| 602 | { | 602 | { |
| @@ -1504,7 +1504,7 @@ compute_motion (ptrdiff_t from, ptrdiff_t frombyte, EMACS_INT fromvpos, | |||
| 1504 | if (cmp_it.id >= 0 | 1504 | if (cmp_it.id >= 0 |
| 1505 | || (pos == cmp_it.stop_pos | 1505 | || (pos == cmp_it.stop_pos |
| 1506 | && composition_reseat_it (&cmp_it, pos, pos_byte, to, win, | 1506 | && composition_reseat_it (&cmp_it, pos, pos_byte, to, win, |
| 1507 | NEUTRAL_DIR, NULL, Qnil))) | 1507 | -1, NULL, Qnil))) |
| 1508 | composition_update_it (&cmp_it, pos, pos_byte, Qnil); | 1508 | composition_update_it (&cmp_it, pos, pos_byte, Qnil); |
| 1509 | if (cmp_it.id >= 0) | 1509 | if (cmp_it.id >= 0) |
| 1510 | { | 1510 | { |
diff --git a/src/lisp.h b/src/lisp.h index 54ade65443f..5ef31eff31e 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -3822,6 +3822,25 @@ extern void mark_maybe_objects (Lisp_Object const *, ptrdiff_t); | |||
| 3822 | extern void mark_stack (char const *, char const *); | 3822 | extern void mark_stack (char const *, char const *); |
| 3823 | extern void flush_stack_call_func1 (void (*func) (void *arg), void *arg); | 3823 | extern void flush_stack_call_func1 (void (*func) (void *arg), void *arg); |
| 3824 | 3824 | ||
| 3825 | /* Force callee-saved registers and register windows onto the stack, | ||
| 3826 | so that conservative garbage collection can see their values. */ | ||
| 3827 | #ifndef HAVE___BUILTIN_UNWIND_INIT | ||
| 3828 | # ifdef __sparc__ | ||
| 3829 | /* This trick flushes the register windows so that all the state of | ||
| 3830 | the process is contained in the stack. | ||
| 3831 | FreeBSD does not have a ta 3 handler, so handle it specially. | ||
| 3832 | FIXME: Code in the Boehm GC suggests flushing (with 'flushrs') is | ||
| 3833 | needed on ia64 too. See mach_dep.c, where it also says inline | ||
| 3834 | assembler doesn't work with relevant proprietary compilers. */ | ||
| 3835 | # if defined __sparc64__ && defined __FreeBSD__ | ||
| 3836 | # define __builtin_unwind_init() asm ("flushw") | ||
| 3837 | # else | ||
| 3838 | # define __builtin_unwind_init() asm ("ta 3") | ||
| 3839 | # endif | ||
| 3840 | # else | ||
| 3841 | # define __builtin_unwind_init() ((void) 0) | ||
| 3842 | # endif | ||
| 3843 | #endif | ||
| 3825 | INLINE void | 3844 | INLINE void |
| 3826 | flush_stack_call_func (void (*func) (void *arg), void *arg) | 3845 | flush_stack_call_func (void (*func) (void *arg), void *arg) |
| 3827 | { | 3846 | { |
diff --git a/src/nsterm.m b/src/nsterm.m index 0e405fc0175..df7f716f51e 100644 --- a/src/nsterm.m +++ b/src/nsterm.m | |||
| @@ -5476,7 +5476,8 @@ ns_term_init (Lisp_Object display_name) | |||
| 5476 | { | 5476 | { |
| 5477 | NSColorList *cl = [NSColorList colorListNamed: @"Emacs"]; | 5477 | NSColorList *cl = [NSColorList colorListNamed: @"Emacs"]; |
| 5478 | 5478 | ||
| 5479 | if ( cl == nil ) | 5479 | /* There are 752 colors defined in rgb.txt. */ |
| 5480 | if ( cl == nil || [[cl allKeys] count] < 752) | ||
| 5480 | { | 5481 | { |
| 5481 | Lisp_Object color_file, color_map, color; | 5482 | Lisp_Object color_file, color_map, color; |
| 5482 | unsigned long c; | 5483 | unsigned long c; |
diff --git a/src/pdumper.c b/src/pdumper.c index 2bda3a85cd1..28529d63648 100644 --- a/src/pdumper.c +++ b/src/pdumper.c | |||
| @@ -764,8 +764,9 @@ dump_off_from_lisp (Lisp_Object value) | |||
| 764 | intmax_t n = intmax_t_from_lisp (value); | 764 | intmax_t n = intmax_t_from_lisp (value); |
| 765 | eassert (DUMP_OFF_MIN <= n && n <= DUMP_OFF_MAX); | 765 | eassert (DUMP_OFF_MIN <= n && n <= DUMP_OFF_MAX); |
| 766 | ALLOW_IMPLICIT_CONVERSION; | 766 | ALLOW_IMPLICIT_CONVERSION; |
| 767 | return n; | 767 | dump_off converted = n; |
| 768 | DISALLOW_IMPLICIT_CONVERSION; | 768 | DISALLOW_IMPLICIT_CONVERSION; |
| 769 | return converted; | ||
| 769 | } | 770 | } |
| 770 | 771 | ||
| 771 | static Lisp_Object | 772 | static Lisp_Object |
diff --git a/src/regex-emacs.c b/src/regex-emacs.c index ba7f3cef64b..1ecbc74b96c 100644 --- a/src/regex-emacs.c +++ b/src/regex-emacs.c | |||
| @@ -29,6 +29,10 @@ | |||
| 29 | 29 | ||
| 30 | #include <stdlib.h> | 30 | #include <stdlib.h> |
| 31 | 31 | ||
| 32 | #ifdef HAVE_SANITIZER_LSAN_INTERFACE_H | ||
| 33 | #include <sanitizer/lsan_interface.h> | ||
| 34 | #endif | ||
| 35 | |||
| 32 | #include "character.h" | 36 | #include "character.h" |
| 33 | #include "buffer.h" | 37 | #include "buffer.h" |
| 34 | #include "syntax.h" | 38 | #include "syntax.h" |
| @@ -1757,6 +1761,9 @@ regex_compile (re_char *pattern, ptrdiff_t size, | |||
| 1757 | /* Initialize the compile stack. */ | 1761 | /* Initialize the compile stack. */ |
| 1758 | compile_stack.stack = xmalloc (INIT_COMPILE_STACK_SIZE | 1762 | compile_stack.stack = xmalloc (INIT_COMPILE_STACK_SIZE |
| 1759 | * sizeof *compile_stack.stack); | 1763 | * sizeof *compile_stack.stack); |
| 1764 | #ifdef HAVE___LSAN_IGNORE_OBJECT | ||
| 1765 | __lsan_ignore_object (compile_stack.stack); | ||
| 1766 | #endif | ||
| 1760 | compile_stack.size = INIT_COMPILE_STACK_SIZE; | 1767 | compile_stack.size = INIT_COMPILE_STACK_SIZE; |
| 1761 | compile_stack.avail = 0; | 1768 | compile_stack.avail = 0; |
| 1762 | 1769 | ||
diff --git a/src/search.c b/src/search.c index ec076c18035..7b74ff91480 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/>. */ | |||
| 21 | 21 | ||
| 22 | #include <config.h> | 22 | #include <config.h> |
| 23 | 23 | ||
| 24 | #ifdef HAVE_SANITIZER_LSAN_INTERFACE_H | ||
| 25 | #include <sanitizer/lsan_interface.h> | ||
| 26 | #endif | ||
| 27 | |||
| 24 | #include "lisp.h" | 28 | #include "lisp.h" |
| 25 | #include "character.h" | 29 | #include "character.h" |
| 26 | #include "buffer.h" | 30 | #include "buffer.h" |
| @@ -613,7 +617,12 @@ newline_cache_on_off (struct buffer *buf) | |||
| 613 | { | 617 | { |
| 614 | /* It should be on. */ | 618 | /* It should be on. */ |
| 615 | if (base_buf->newline_cache == 0) | 619 | if (base_buf->newline_cache == 0) |
| 616 | base_buf->newline_cache = new_region_cache (); | 620 | { |
| 621 | base_buf->newline_cache = new_region_cache (); | ||
| 622 | #ifdef HAVE___LSAN_IGNORE_OBJECT | ||
| 623 | __lsan_ignore_object (base_buf->newline_cache); | ||
| 624 | #endif | ||
| 625 | } | ||
| 617 | } | 626 | } |
| 618 | return base_buf->newline_cache; | 627 | return base_buf->newline_cache; |
| 619 | } | 628 | } |
diff --git a/src/xdisp.c b/src/xdisp.c index eb7f3e7baa1..fc17014c029 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -4339,7 +4339,7 @@ face_at_pos (const struct it *it, enum lface_attribute_index attr_filter) | |||
| 4339 | (IT_CHARPOS (*it) | 4339 | (IT_CHARPOS (*it) |
| 4340 | + TEXT_PROP_DISTANCE_LIMIT), | 4340 | + TEXT_PROP_DISTANCE_LIMIT), |
| 4341 | false, | 4341 | false, |
| 4342 | from_overlay); | 4342 | from_overlay, attr_filter); |
| 4343 | } | 4343 | } |
| 4344 | else | 4344 | else |
| 4345 | { | 4345 | { |
diff --git a/src/xfaces.c b/src/xfaces.c index c4a4e1c94f3..585cfa1cf4a 100644 --- a/src/xfaces.c +++ b/src/xfaces.c | |||
| @@ -6475,7 +6475,8 @@ face_at_buffer_position (struct window *w, ptrdiff_t pos, | |||
| 6475 | int | 6475 | int |
| 6476 | face_for_overlay_string (struct window *w, ptrdiff_t pos, | 6476 | face_for_overlay_string (struct window *w, ptrdiff_t pos, |
| 6477 | ptrdiff_t *endptr, ptrdiff_t limit, | 6477 | ptrdiff_t *endptr, ptrdiff_t limit, |
| 6478 | bool mouse, Lisp_Object overlay) | 6478 | bool mouse, Lisp_Object overlay, |
| 6479 | enum lface_attribute_index attr_filter) | ||
| 6479 | { | 6480 | { |
| 6480 | struct frame *f = XFRAME (w->frame); | 6481 | struct frame *f = XFRAME (w->frame); |
| 6481 | Lisp_Object attrs[LFACE_VECTOR_SIZE]; | 6482 | Lisp_Object attrs[LFACE_VECTOR_SIZE]; |
| @@ -6514,7 +6515,7 @@ face_for_overlay_string (struct window *w, ptrdiff_t pos, | |||
| 6514 | 6515 | ||
| 6515 | /* Merge in attributes specified via text properties. */ | 6516 | /* Merge in attributes specified via text properties. */ |
| 6516 | if (!NILP (prop)) | 6517 | if (!NILP (prop)) |
| 6517 | merge_face_ref (w, f, prop, attrs, true, NULL, 0); | 6518 | merge_face_ref (w, f, prop, attrs, true, NULL, attr_filter); |
| 6518 | 6519 | ||
| 6519 | *endptr = endpos; | 6520 | *endptr = endpos; |
| 6520 | 6521 | ||