[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
From: |
Alan Mackenzie |
Subject: |
Questionable code in handling of wordend in the regexp engine in regex-emacs.c |
Date: |
Fri, 22 Feb 2019 16:45:22 +0000 |
User-agent: |
Mutt/1.10.1 (2018-07-13) |
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).
- Questionable code in handling of wordend in the regexp engine in regex-emacs.c,
Alan Mackenzie <=