aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2012-03-01 18:29:30 -0800
committerPaul Eggert2012-03-01 18:29:30 -0800
commit9d6b4d53469a9ffd67bd770fabc6fe254e35c21d (patch)
treede238c6f707915be9ed1f10235589b4e975a08fb /src
parenta89654f8f34114db543cb91363e8fded6d73e986 (diff)
parenteec1549a6b89359b6d970f14dead275e59b7bc6f (diff)
downloademacs-9d6b4d53469a9ffd67bd770fabc6fe254e35c21d.tar.gz
emacs-9d6b4d53469a9ffd67bd770fabc6fe254e35c21d.zip
Merge from trunk.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog24
-rw-r--r--src/alloc.c29
-rw-r--r--src/fileio.c19
-rw-r--r--src/lisp.h18
-rw-r--r--src/xdisp.c17
5 files changed, 81 insertions, 26 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 71ddf053dac..d477d0574b3 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,4 +1,4 @@
12012-02-25 Paul Eggert <eggert@cs.ucla.edu> 12012-03-02 Paul Eggert <eggert@cs.ucla.edu>
2 2
3 Fix integer width and related bugs (Bug#9874). 3 Fix integer width and related bugs (Bug#9874).
4 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp): 4 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
@@ -788,8 +788,30 @@
788 rather than rolling our own approximation. 788 rather than rolling our own approximation.
789 (SCROLL_BAR_VEC_SIZE): Remove; not used. 789 (SCROLL_BAR_VEC_SIZE): Remove; not used.
790 790
7912012-02-29 Eli Zaretskii <eliz@gnu.org>
792
793 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
794 push_it before setting up the iterator for the first overlay
795 string, even if we have an empty string loaded.
796 (next_overlay_string): If there's an empty string on the iterator
797 stack, pop the stack. (Bug#10903)
798
7992012-02-25 Paul Eggert <eggert@cs.ucla.edu>
800
801 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
802 Suggested by Stefan Monnier in
803 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
804 * alloc.c (widen_to_Lisp_Object): New static function.
805 (mark_memory): Also mark Lisp_Objects by fetching pointer words
806 and widening them to Lisp_Objects. This would work even if
807 USE_LSB_TAG is defined and wide integers are used, which might
808 happen in a future version of Emacs.
809
7912012-02-25 Chong Yidong <cyd@gnu.org> 8102012-02-25 Chong Yidong <cyd@gnu.org>
792 811
812 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
813 Doc fix.
814
793 * xselect.c (Fx_selection_exists_p): Doc fix. 815 * xselect.c (Fx_selection_exists_p): Doc fix.
794 (x_clipboard_manager_save_all): Print an informative message 816 (x_clipboard_manager_save_all): Print an informative message
795 before saving to clipboard manager. 817 before saving to clipboard manager.
diff --git a/src/alloc.c b/src/alloc.c
index c4db234aba5..6e4cfa07fa0 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -1582,6 +1582,21 @@ make_number (EMACS_INT n)
1582} 1582}
1583#endif 1583#endif
1584 1584
1585/* Convert the pointer-sized word P to EMACS_INT while preserving its
1586 type and ptr fields. */
1587static Lisp_Object
1588widen_to_Lisp_Object (void *p)
1589{
1590 intptr_t i = (intptr_t) p;
1591#ifdef USE_LISP_UNION_TYPE
1592 Lisp_Object obj;
1593 obj.i = i;
1594 return obj;
1595#else
1596 return i;
1597#endif
1598}
1599
1585/*********************************************************************** 1600/***********************************************************************
1586 String Allocation 1601 String Allocation
1587 ***********************************************************************/ 1602 ***********************************************************************/
@@ -4294,7 +4309,19 @@ mark_memory (void *start, void *end)
4294 4309
4295 for (pp = start; (void *) pp < end; pp++) 4310 for (pp = start; (void *) pp < end; pp++)
4296 for (i = 0; i < sizeof *pp; i += GC_POINTER_ALIGNMENT) 4311 for (i = 0; i < sizeof *pp; i += GC_POINTER_ALIGNMENT)
4297 mark_maybe_pointer (*(void **) ((char *) pp + i)); 4312 {
4313 void *w = *(void **) ((char *) pp + i);
4314 mark_maybe_pointer (w);
4315
4316#ifdef USE_LSB_TAG
4317 /* A host where a Lisp_Object is wider than a pointer might
4318 allocate a Lisp_Object in non-adjacent halves. If
4319 USE_LSB_TAG, the bottom half is not a valid pointer, so
4320 widen it to to a Lisp_Object and check it that way. */
4321 if (sizeof w < sizeof (Lisp_Object))
4322 mark_maybe_object (widen_to_Lisp_Object (w));
4323#endif
4324 }
4298} 4325}
4299 4326
4300/* setjmp will work with GCC unless NON_SAVING_SETJMP is defined in 4327/* setjmp will work with GCC unless NON_SAVING_SETJMP is defined in
diff --git a/src/fileio.c b/src/fileio.c
index b5a4aac6217..3cd44df012b 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -2798,9 +2798,13 @@ See `file-symlink-p' to distinguish symlinks. */)
2798 2798
2799DEFUN ("file-selinux-context", Ffile_selinux_context, 2799DEFUN ("file-selinux-context", Ffile_selinux_context,
2800 Sfile_selinux_context, 1, 1, 0, 2800 Sfile_selinux_context, 1, 1, 0,
2801 doc: /* Return SELinux context of file named FILENAME, 2801 doc: /* Return SELinux context of file named FILENAME.
2802as a list ("user", "role", "type", "range"). Return (nil, nil, nil, nil) 2802The return value is a list (USER ROLE TYPE RANGE), where the list
2803if file does not exist, is not accessible, or SELinux is disabled */) 2803elements are strings naming the user, role, type, and range of the
2804file's SELinux security context.
2805
2806Return (nil nil nil nil) if the file is nonexistent or inaccessible,
2807or if SELinux is disabled, or if Emacs lacks SELinux support. */)
2804 (Lisp_Object filename) 2808 (Lisp_Object filename)
2805{ 2809{
2806 Lisp_Object absname; 2810 Lisp_Object absname;
@@ -2853,9 +2857,12 @@ if file does not exist, is not accessible, or SELinux is disabled */)
2853 2857
2854DEFUN ("set-file-selinux-context", Fset_file_selinux_context, 2858DEFUN ("set-file-selinux-context", Fset_file_selinux_context,
2855 Sset_file_selinux_context, 2, 2, 0, 2859 Sset_file_selinux_context, 2, 2, 0,
2856 doc: /* Set SELinux context of file named FILENAME to CONTEXT 2860 doc: /* Set SELinux context of file named FILENAME to CONTEXT.
2857as a list ("user", "role", "type", "range"). Has no effect if SELinux 2861CONTEXT should be a list (USER ROLE TYPE RANGE), where the list
2858is disabled. */) 2862elements are strings naming the components of a SELinux context.
2863
2864This function does nothing if SELinux is disabled, or if Emacs was not
2865compiled with SELinux support. */)
2859 (Lisp_Object filename, Lisp_Object context) 2866 (Lisp_Object filename, Lisp_Object context)
2860{ 2867{
2861 Lisp_Object absname; 2868 Lisp_Object absname;
diff --git a/src/lisp.h b/src/lisp.h
index 8c274cddb56..47570ebee74 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -197,22 +197,8 @@ extern int suppress_checking EXTERNALLY_VISIBLE;
197# if defined DECL_ALIGN 197# if defined DECL_ALIGN
198/* On hosts where VALBITS is greater than the pointer width in bits, 198/* On hosts where VALBITS is greater than the pointer width in bits,
199 USE_LSB_TAG is: 199 USE_LSB_TAG is:
200 200 a. unnecessary, because the top bits of an EMACS_INT are unused, and
201 a. unnecessary, because the top bits of an EMACS_INT are unused, 201 b. slower, because it typically requires extra masking.
202
203 b. slower, because it typically requires extra masking, and
204
205 c. harmful, because it can create Lisp_Object values that are so scrambled
206 that mark_maybe_object cannot decipher them. mark_maybe_object assumes
207 that EMACS_INT values are contiguous, but a host where EMACS_INT is
208 wider than a pointer might allocate the top half of an EMACS_INT in
209 (say) a 32-bit word on the stack, putting the bottom half in a 32-bit
210 register that is saved elsewhere in a jmp_buf. When this happens,
211 since USE_LSB_TAG is not defined the bottom half alone is a valid
212 pointer that mark_maybe_pointer can follow; but if USE_LSB_TAG were
213 defined, the bottom half would not be a valid pointer and neither
214 mark_maybe_object nor mark_maybe_pointer would follow it.
215
216 So, define USE_LSB_TAG only on hosts where it might be useful. */ 202 So, define USE_LSB_TAG only on hosts where it might be useful. */
217# if UINTPTR_MAX >> VALBITS != 0 203# if UINTPTR_MAX >> VALBITS != 0
218# define USE_LSB_TAG 204# define USE_LSB_TAG
diff --git a/src/xdisp.c b/src/xdisp.c
index caf977633d8..c3403031650 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -5159,6 +5159,12 @@ next_overlay_string (struct it *it)
5159 it->current.overlay_string_index = -1; 5159 it->current.overlay_string_index = -1;
5160 it->n_overlay_strings = 0; 5160 it->n_overlay_strings = 0;
5161 it->overlay_strings_charpos = -1; 5161 it->overlay_strings_charpos = -1;
5162 /* If there's an empty display string on the stack, pop the
5163 stack, to resync the bidi iterator with IT's position. Such
5164 empty strings are pushed onto the stack in
5165 get_overlay_strings_1. */
5166 if (it->sp > 0 && STRINGP (it->string) && !SCHARS (it->string))
5167 pop_it (it);
5162 5168
5163 /* If we're at the end of the buffer, record that we have 5169 /* If we're at the end of the buffer, record that we have
5164 processed the overlay strings there already, so that 5170 processed the overlay strings there already, so that
@@ -5461,8 +5467,15 @@ get_overlay_strings_1 (struct it *it, ptrdiff_t charpos, int compute_stop_p)
5461 xassert (!compute_stop_p || it->sp == 0); 5467 xassert (!compute_stop_p || it->sp == 0);
5462 5468
5463 /* When called from handle_stop, there might be an empty display 5469 /* When called from handle_stop, there might be an empty display
5464 string loaded. In that case, don't bother saving it. */ 5470 string loaded. In that case, don't bother saving it. But
5465 if (!STRINGP (it->string) || SCHARS (it->string)) 5471 don't use this optimization with the bidi iterator, since we
5472 need the corresponding pop_it call to resync the bidi
5473 iterator's position with IT's position, after we are done
5474 with the overlay strings. (The corresponding call to pop_it
5475 in case of an empty display string is in
5476 next_overlay_string.) */
5477 if (!(!it->bidi_p
5478 && STRINGP (it->string) && !SCHARS (it->string)))
5466 push_it (it, NULL); 5479 push_it (it, NULL);
5467 5480
5468 /* Set up IT to deliver display elements from the first overlay 5481 /* Set up IT to deliver display elements from the first overlay