[perl #79152] super-linear cache can prevent a valid match
authorNick Cleaton <nick@cleaton.net>
Tue, 30 Nov 2010 06:26:43 +0000 (22:26 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Tue, 30 Nov 2010 13:01:59 +0000 (05:01 -0800)
commit779bcb7d68c0d77839c133a5b8429f43e63a961f
tree070965ea567c7d41ba3d794923a9f25612785f2c
parentf603091d864eb38dabe995c559f17edd4ea9e2d6
[perl #79152] super-linear cache can prevent a valid match

The super-linear cache in regexec.c can prevent a valid match
from being detected. For example:

print "yay\n" if 'xayxay' =~ /(q1|.)*(q2|.)*(x(a|bc)*y){2,}/;

This should match, but it doesn't because the cache fails to
distinguish between matching the final xay to x(a|bc)*y as the
first instance of the {2,} and matching it in the same position
as the second instance.

This seems to do the trick.
regcomp.c
t/re/re_tests