Subject: bug#21688: 25.0.50; abort in regex.c during "align"

From: Stefan Monnier <[email-masked]>
Date: Sun, 25 Oct 2015 22:57:54 -0400

> I'm getting an abort in the regex code while doing an align operation on
> some perl code.  I've boiled down a test case to reproduce it to this:
[...]
> The abort at 6256 is in the switch statement after the "fail" label.
> Since "pat" is only three bytes into the buffer, the value branched on
> would've been two bytes in, a 1, which is the "succeed" enumerator,
> which isn't expected in that switch statement.

I think the issue is simply that syntax-propertization is now done
on-the-fly during regexp-matching and that this is wrong: the regexp
code is not re-entrant, so if syntax-propertization happens from
regexp-matching and performs regexp-matching itself we're likely to see
weird behaviors.

I think the fix is to make regexp.c use a new
UPDATE_SYNTAX_TABLE_FORWARD_FAST (which doesn't pay attention to
syntax-propertize--done) instead of UPDATE_SYNTAX_TABLE_FORWARD.

        Stefan