changeset 110576:54834381dfd9

* src/insdel.c (prepare_to_modify_buffer): Ensure the mark marker is alive before using it (Bug#6977).
author Chong Yidong <cyd@stupidchicken.com>
date Sat, 25 Sep 2010 15:50:13 -0400
parents bc67a5497dda
children 71576987bc2d
files src/ChangeLog src/insdel.c
diffstat 2 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Sat Sep 25 15:19:41 2010 -0400
+++ b/src/ChangeLog	Sat Sep 25 15:50:13 2010 -0400
@@ -1,3 +1,8 @@
+2010-09-25  Chong Yidong  <cyd@stupidchicken.com>
+
+	* insdel.c (prepare_to_modify_buffer): Ensure the mark marker is
+	alive before using it (Bug#6977).
+
 2010-09-25  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
 	* xdisp.c (face_before_or_after_it_pos): EMACS_INT/int fixup.
--- a/src/insdel.c	Sat Sep 25 15:19:41 2010 -0400
+++ b/src/insdel.c	Sat Sep 25 15:50:13 2010 -0400
@@ -2051,13 +2051,14 @@
 
   /* If `select-active-regions' is non-nil, save the region text.  */
   if (!NILP (current_buffer->mark_active)
+      && XMARKER (current_buffer->mark)->buffer
       && NILP (Vsaved_region_selection)
       && (EQ (Vselect_active_regions, Qonly)
 	  ? EQ (CAR_SAFE (Vtransient_mark_mode), Qonly)
 	  : (!NILP (Vselect_active_regions)
 	     && !NILP (Vtransient_mark_mode))))
     {
-      EMACS_INT b = XINT (Fmarker_position (current_buffer->mark));
+      EMACS_INT b = XMARKER (current_buffer->mark)->charpos;
       EMACS_INT e = PT;
       if (b < e)
 	Vsaved_region_selection = make_buffer_string (b, e, 0);