[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Questionable code in handling of wordend in the regexp engine in regex-e
Questionable code in handling of wordend in the regexp engine in regex-emacs.c
Fri, 22 Feb 2019 16:45:22 +0000
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
before determining the syntax of the previous character, which seems OK.
Later on, before determining the syntax of the next character, we have:
. 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
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
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).
- Questionable code in handling of wordend in the regexp engine in regex-emacs.c,
Alan Mackenzie <=