In perl.git, the branch maint-5.10 has been updated <http://perl5.git.perl.org/perl.git/commitdiff/fad6babab69dc6056cdaded02df5353d31680d19?hp=a4f9a02cefca01b4fd5c23a6c1050fbcc67712a9>
- Log ----------------------------------------------------------------- commit fad6babab69dc6056cdaded02df5353d31680d19 Author: [email protected] <[email protected]> Date: Mon Jul 6 15:45:12 2009 +0100 Regex fails when string is too long This looks to be a simple oversight. All tests pass here. Hugo Signed-off-by: H.Merijn Brand <[email protected]> (cherry picked from commit 84d2fa142c064fe21af5121174d51b764b9d9c69) M regexec.c M t/op/pat.t commit e037adc588a0bceed0303fcb5b1982995b33686a Author: David Mitchell <[email protected]> Date: Tue Jul 7 12:38:05 2009 +0100 Revert "temporary hack to make Win32API-File build under maint" This reverts commit 00e0b152e4ddec7f51f78e3de2d4aeb0232d647e. should not longer be needed now EU::MM 6.53_03 is here M ext/Win32API-File/Makefile.PL ----------------------------------------------------------------------- Summary of changes: ext/Win32API-File/Makefile.PL | 3 +-- regexec.c | 5 +++-- t/op/pat.t | 17 ++++++++++++++++- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/ext/Win32API-File/Makefile.PL b/ext/Win32API-File/Makefile.PL index ade8bfa..6e5511a 100644 --- a/ext/Win32API-File/Makefile.PL +++ b/ext/Win32API-File/Makefile.PL @@ -31,8 +31,7 @@ WriteMakefile( 'PREREQ_PM' => { 'IO::File' => 0, #build 'File::Spec' => 0, #build - # XXX tmp ignore to stop build failures - # 'Math::BigInt' => 0, + 'Math::BigInt' => 0, 'Win32' => 0, } ); diff --git a/regexec.c b/regexec.c index b3c8ff2..7a42c4f 100644 --- a/regexec.c +++ b/regexec.c @@ -4363,7 +4363,7 @@ NULL case CURLYM: /* /A{m,n}B/ where A is fixed-length */ /* This is an optimisation of CURLYX that enables us to push - * only a single backtracking state, no matter now many matches + * only a single backtracking state, no matter how many matches * there are in {m,n}. It relies on the pattern being constant * length, with no parens to influence future backrefs */ @@ -4526,7 +4526,8 @@ NULL case CURLYM_B_fail: /* just failed to match a B */ REGCP_UNWIND(ST.cp); if (ST.minmod) { - if (ST.count == ARG2(ST.me) /* max */) + I32 max = ARG2(ST.me); + if (max != REG_INFTY && ST.count == max) sayNO; goto curlym_do_A; /* try to match a further A */ } diff --git a/t/op/pat.t b/t/op/pat.t index 29f3a05..3ee799d 100644 --- a/t/op/pat.t +++ b/t/op/pat.t @@ -13,7 +13,7 @@ sub run_tests; $| = 1; -my $EXPECTED_TESTS = 4061; # Update this when adding/deleting tests. +my $EXPECTED_TESTS = 4065; # Update this when adding/deleting tests. BEGIN { chdir 't' if -d 't'; @@ -4348,6 +4348,21 @@ sub run_tests { iseq($str, "\$1 = undef, \$2 = undef, \$3 = undef, \$4 = undef, \$5 = undef, \$^R = undef"); } } + + { + local $BugId = 65372; # minimal CURLYM limited to 32767 matches + my @pat = ( + qr{a(x|y)*b}, # CURLYM + qr{a(x|y)*?b}, # .. with minmod + qr{a([wx]|[yz])*b}, # .. and without tries + qr{a([wx]|[yz])*?b}, + ); + my $len = 32768; + my $s = join '', 'a', 'x' x $len, 'b'; + for my $pat (@pat) { + ok($s =~ $pat, $pat); + } + } # # This should be the last test. # -- Perl5 Master Repository
