This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regcomp.c: Optimization not valid for Latin Sharp S
authorKarl Williamson <public@khwilliamson.com>
Sat, 11 Aug 2012 20:19:45 +0000 (14:19 -0600)
committerKarl Williamson <public@khwilliamson.com>
Sun, 12 Aug 2012 01:32:32 +0000 (19:32 -0600)
commit7dff6b46615bc7810e4e66f957fe993b1c0a968d
tree1ecf9d247d36e8a4fba5965f776855947f3ba51e
parent7d103382d5bb85c8a8b1caa5ada8ea405c895a41
regcomp.c: Optimization not valid for Latin Sharp S

The regex optimizer optimizes some quantifier expressions into simpler
versions.  It turns out that these optimizations don't work on a
quantified, folded LATIN SMALL LETTER SHARP S under /d.  This is due to
the size differential of the fold from the source.

This commit omits the optimization if this circumstance occurs anywhere
in the regex prior to the determination of whether to optimize or not.
I tried adding a parameter to study_chunk() to indicate more locally if
the optimization should be excluded or not; but my first attempt did not
fix the bug, and I chose to not pursue that line.  This character is so
abnormal that it's probably best anyway to be overly cautious when
confronted with it.
regcomp.c
t/re/re_tests