>>>> "Matt" == Matt Tucker
<tuck(a)whistlingfish.net> writes:
Matt> This one's the syntax stuff again. I'm pretty sure that all
Matt> of these 'VALID_BYTIND_P' crashes (there are at least three
Matt> that I know of) are the same error, or at least
Matt> related. Fortunately this particular one is easily
Matt> reproducible on my system, so I'm sure I'll be able to get
Matt> this figured out within the next day or two.
I got this one, same stack trace as Norbert, I think.
The offending code in my dump seems to be at 4319 of regex.c:
#ifdef emacs
{
int adjpos = NILP (regex_match_object) || BUFFERP (regex_match_object) ? 1 : 0;
SETUP_SYNTAX_CACHE_FOR_OBJECT (regex_match_object,
regex_emacs_buffer,
SYNTAX_CACHE_OBJECT_BYTE_TO_CHAR (regex_match_object,
regex_emacs_buffer,
pos + adjpos),
1);
}
#endif
The problem is apparently in the assumption that adjpos is 0 or 1.
The regex code works on bytes, not on Mule characters, assuming that
both the regexp and the target text are properly formatted Mule text.
(Cf comment at head of re_search_2. A little reflection will show
that this will work as long as you are careful about compiling the
regexp, treating Mule characters as concatenated bytes, with
exceptions like "match any character", which only matches leading
bytes and then must "jump over" any trailing bytes.) So adjpos is a
variable which depends on the current character's size.
I suspect the correct idiom is to use INC_CHARPTR on pos. You should
_not_ use VALIDATE_CHARPTR_FORWARD on (pos + adjpos), as that assumes
that you are not at the last character in the string. I don't see how
you can test that without more trouble than its worth. See buffer.h,
starting about l. 265 for lots of caveats about this kind of thing.
These changes may require fiddling with the new code (changing array
manipulations to pointer idioms, eg) to get them to make sense.
--
University of Tsukuba Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
Institute of Policy and Planning Sciences Tel/fax: +81 (298) 53-5091
_________________ _________________ _________________ _________________
What are those straight lines for? "XEmacs rules."