all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Questionable code in handling of wordend in the regexp engine in regex-emacs.c
@ 2019-02-22 16:45 Alan Mackenzie
  2019-02-23 23:15 ` Stefan Monnier
  0 siblings, 1 reply; 22+ messages in thread
From: Alan Mackenzie @ 2019-02-22 16:45 UTC (permalink / raw)
  To: emacs-devel

Hello, Emacs.

In function re_match_2_internal (in regex-emacs.c) in the handling of
case wordend: inside the large switch statement (approximately line 4800
in the file), there is some code, the look of which I don't like.

Primarily, there is an

    UPDATE_SYNTAX_TABLE (charpos);

before determining the syntax of the previous character, which seems OK.
Later on, before determining the syntax of the next character, we have:

    UPDATE_SYNTAX_TABLE_FORWARD (charpos);

.  Between these two calls, charpos hasn't been changed.  Surely the
argument to the second occurrence should be (charpos + 1)?



Also, probably less importantly, there is

    GET_CHAR_AFTER (c2, d, dummy);

, whereas at the same place in the handler for case symend: we have
instead

    c2 = RE_STRING_CHAR (d, target_multibyte);

.  Is the effect of these macros identical, or is one of them up to
date, and the other one really needs updating as well, for correct
functionality?



I came across these whilst investigating bug #34525.  Making the
indicated changes to regex-emacs.c sadly doesn't help solve the symptoms
of that bug.  :-(

-- 
Alan Mackenzie (Nuremberg, Germany).



^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2019-03-05 16:26 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-22 16:45 Questionable code in handling of wordend in the regexp engine in regex-emacs.c Alan Mackenzie
2019-02-23 23:15 ` Stefan Monnier
2019-02-25 18:56   ` Alan Mackenzie
2019-02-25 19:18     ` Stefan Monnier
2019-03-01 11:10       ` Alan Mackenzie
2019-03-01 13:41         ` Stefan Monnier
2019-03-01 13:46         ` Eli Zaretskii
2019-03-01 14:14           ` Alan Mackenzie
2019-03-01 14:43             ` Eli Zaretskii
2019-03-01 14:58               ` Alan Mackenzie
2019-03-01 16:22                 ` Eli Zaretskii
2019-03-01 16:38                   ` Alan Mackenzie
2019-03-01 19:16                     ` Alan Mackenzie
2019-03-01 19:31                       ` Eli Zaretskii
2019-03-02 11:16                         ` Alan Mackenzie
2019-03-02 12:18                           ` Eli Zaretskii
2019-03-02 13:18                             ` Alan Mackenzie
2019-03-02 13:37                               ` Eli Zaretskii
2019-03-04 17:25                               ` Eli Zaretskii
2019-03-05 10:51                                 ` Alan Mackenzie
2019-03-05 16:26                                   ` Eli Zaretskii
2019-03-02 12:21                           ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.