From: Chong Yidong Date: Sat, 25 Sep 2010 19:50:13 +0000 (-0400) Subject: * src/insdel.c (prepare_to_modify_buffer): Ensure the mark marker is alive X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~438^2~47^2~42^2~22 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d24ec09aee53c057d4ff30d84b44aa044d4f6805;p=emacs.git * src/insdel.c (prepare_to_modify_buffer): Ensure the mark marker is alive before using it (Bug#6977). --- diff --git a/src/ChangeLog b/src/ChangeLog index 38b24f8559b..29071a36b0e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2010-09-25 Chong Yidong + + * insdel.c (prepare_to_modify_buffer): Ensure the mark marker is + alive before using it (Bug#6977). + 2010-09-25 Lars Magne Ingebrigtsen * xdisp.c (face_before_or_after_it_pos): EMACS_INT/int fixup. diff --git a/src/insdel.c b/src/insdel.c index fb26fe77ac2..abe6f350585 100644 --- a/src/insdel.c +++ b/src/insdel.c @@ -2051,13 +2051,14 @@ prepare_to_modify_buffer (EMACS_INT start, EMACS_INT end, /* 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);