emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Questionable code in handling of wordend in the regexp engine in reg


From: Eli Zaretskii
Subject: Re: Questionable code in handling of wordend in the regexp engine in regex-emacs.c
Date: Fri, 01 Mar 2019 18:22:39 +0200

> Date: Fri, 1 Mar 2019 14:58:56 +0000
> Cc: address@hidden, address@hidden
> From: Alan Mackenzie <address@hidden>
> 
> > > Thanks, I didn't know that.  Maybe we should put an assert into the code,
> > > like Stefan suggested.
> 
> > We could try.
> 
> How about this, as a first approximation?
> [...]
> +      /* Check BYTEPOS was at a character boundary. */
> +      eassert (best_below_byte == bytepos);

Actually, what I had in mind was a simple

  eassert (CHAR_HEAD_P (BUF_FETCH_BYTE (b, bytepos)));

right at the beginning of buf_bytepos_to_charpos.  But maybe if you
explain why you wanted a different assertion, I will change my mind.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]