diff options
author | Yves Orton <yves.orton@booking.com> | 2014-02-06 01:39:30 +0800 |
---|---|---|
committer | Yves Orton <yves.orton@booking.com> | 2014-02-06 01:39:30 +0800 |
commit | 66175af586bd8040b474a5d2ddb6e6308424b668 (patch) | |
tree | 430cd6239d65f810f2f3e4d00284c5dd36d65397 /ext/re | |
parent | 460fc215a9b13030155110e46c455f2f678d6aeb (diff) | |
download | perl-66175af586bd8040b474a5d2ddb6e6308424b668.tar.gz |
Fix regression in floating mandatory string optimisation
In 304ee84bde82d4eee33b0d0ff03080b360eae72b I introduced a regression
where floating mandatory strings which were at known offsets started
being treated as though they were allowed "anywhere".
This patch fixes the bug, and adds tests to make sure it does not come
back.
See also discussion in Perl RT #121182.
https://rt.perl.org/Public/Bug/Display.html?id=121182
Diffstat (limited to 'ext/re')
-rw-r--r-- | ext/re/t/regop.pl | 1 | ||||
-rw-r--r-- | ext/re/t/regop.t | 25 |
2 files changed, 25 insertions, 1 deletions
diff --git a/ext/re/t/regop.pl b/ext/re/t/regop.pl index 8969335220..961af390c3 100644 --- a/ext/re/t/regop.pl +++ b/ext/re/t/regop.pl @@ -7,6 +7,7 @@ my @tests=( 'D:\\dev/perl/ver/28321_/perl.exe'=> '/(\\.COM|\\.EXE|\\.BAT|\\.CMD|\\.VBS|\\.VBE|\\.JS|\\.JSE|\\.WSF|\\.WSH|\\.pyo|\\.pyc|\\.pyw|\\.py)$/i', 'q'=>'[q]', + "path_sep:\t8490" => '^(\\S{1,9}):\\s*(\\d+)$' ); while (@tests) { my ($str,$pat)=splice @tests,0,2; diff --git a/ext/re/t/regop.t b/ext/re/t/regop.t index a180756f8f..6eda0ab28c 100644 --- a/ext/re/t/regop.t +++ b/ext/re/t/regop.t @@ -55,7 +55,7 @@ foreach my $testout ( @tests ) { # that the tests for this result set are finished. # If you add a test make sure you update $NUM_SECTS # the commented output is just for legacy/debugging purposes -BEGIN{ $NUM_SECTS= 6 } +BEGIN{ $NUM_SECTS= 7 } __END__ #Compiling REx "X(A|[B]Q||C|D)Y" @@ -259,3 +259,26 @@ Offsets: [3] 1:1[3] 3:4[0] %MATCHED% Freeing REx: "[q]" +--- +#Compiling REx "^(\S{1,9}):\s*(\d+)$" +#synthetic stclass "ANYOF[\x{00}-\x{08}\x{0E}-\x{1F}\x{21}-\x{FF}][{utf8}0100-167F 1681-1FFF 200B-2027 202A-202E 2030-205E 2060-2FFF 3001-INFINITY]". +#Final program: +# 1: BOL (2) +# 2: OPEN1 (4) +# 4: CURLY {1,9} (7) +# 6: NPOSIXD[\s] (0) +# 7: CLOSE1 (9) +# 9: EXACT <:> (11) +# 11: STAR (13) +# 12: POSIXD[\s] (0) +# 13: OPEN2 (15) +# 15: PLUS (17) +# 16: POSIXD[\d] (0) +# 17: CLOSE2 (19) +# 19: EOL (20) +# 20: END (0) +#floating ":" at 1..9 (checking floating) stclass ANYOF[\x{00}-\x{08}\x{0E}-\x{1F}\x{21}-\x{FF}][{utf8}0100-167F 1681-1FFF 200B-2027 202A-202E 2030-205E 2060-2FFF 3001-INFINITY] anchored(BOL) minlen 3 +#Freeing REx: "^(\S{1,9}):\s*(\d+)$" +floating ":" at 1..9 (checking floating) stclass ANYOF[\x{00}-\x{08}\x{0E}-\x{1F}\x{21}-\x{FF}][{utf8}0100-167F 1681-1FFF 200B-2027 202A-202E 2030-205E 2060-2FFF 3001-INFINITY] anchored(BOL) minlen 3 +%MATCHED% +synthetic stclass |