GNU bug report logs - #36431
Crash in marker.c:337

Previous Next

Package: emacs;

Reported by: Werner LEMBERG <wl <at> gnu.org>

Date: Sat, 29 Jun 2019 11:19:01 UTC

Severity: normal

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: wl <at> gnu.org, 36431 <at> debbugs.gnu.org
Subject: bug#36431: Crash in marker.c:337
Date: Wed, 03 Jul 2019 07:55:18 +0300
> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
> Cc: wl <at> gnu.org,  36431 <at> debbugs.gnu.org
> Date: Wed, 03 Jul 2019 00:21:54 -0400
> 
> -      move_gap_both (PT, PT_BYTE);
> -      GAP_SIZE += inserted;
> -      ZV_BYTE -= inserted;
> -      Z_BYTE -= inserted;
> -      ZV -= inserted;
> -      Z -= inserted;
> +      if (ingap)
> +        { /* Text is at beginning of gap, move it to the end.  */
> +          memmove (GAP_END_ADDR - inserted, GPT_ADDR, inserted);
> +        }
> +      else
> +        { /* Text is inside the buffer; move it to end of the gap.  */
> +          move_gap_both (PT, PT_BYTE);
> +	  eassert (inserted == Z_BYTE - BEG_BYTE);
> +          GAP_SIZE += inserted;
> +          ZV = Z = GPT = BEG;
> +          ZV_BYTE = Z_BYTE = GPT_BYTE = BEG_BYTE;
> +          /* Now we are safe to change the buffer's multibyteness directly.  */
> +          bset_enable_multibyte_characters (current_buffer, multibyte);
> +        }
> +

Why did you prefer to use memmove instead of move_gap_both?  AFAIK the
latter actually does the former under the hood, but why expose that
implementation detail outside of insdel.c?




This bug report was last modified 5 years and 312 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.