From 372f8ffc2eaea40d98a15242482a8c771de70dd4 Mon Sep 17 00:00:00 2001 From: Dmitry Antipov Date: Mon, 23 Jul 2012 11:14:58 +0400 Subject: [PATCH] Swap buffer text indirection counters in Fbuffer_swap_text. * buffer.c (Fbuffer_swap_text): Swap indirections too. This avoids crash reported by Christoph Scholtes at http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html. --- src/ChangeLog | 7 +++++++ src/buffer.c | 1 + 2 files changed, 8 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index b89bfc41298..bc486a99bd4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2012-07-22 Dmitry Antipov + + Swap buffer text indirection counters in Fbuffer_swap_text. + * buffer.c (Fbuffer_swap_text): Swap indirections too. + This avoids crash reported by Christoph Scholtes at + http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html. + 2012-07-22 Jan Djärv * nsmenu.m (Popdown_data): New struct. diff --git a/src/buffer.c b/src/buffer.c index 5f9f6a79b67..68208d17abe 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -2145,6 +2145,7 @@ DEFUN ("buffer-swap-text", Fbuffer_swap_text, Sbuffer_swap_text, swapfield (zv_byte, ptrdiff_t); eassert (!current_buffer->base_buffer); eassert (!other_buffer->base_buffer); + swapfield (indirections, ptrdiff_t); current_buffer->clip_changed = 1; other_buffer->clip_changed = 1; swapfield (newline_cache, struct region_cache *); swapfield (width_run_cache, struct region_cache *); -- 2.39.2