In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/ab4c2c27cb4fd913cd324319b6e04e879e5eb2b6?hp=70eadc36be15a2576561830a2c1b077d308db7de>
- Log ----------------------------------------------------------------- commit ab4c2c27cb4fd913cd324319b6e04e879e5eb2b6 Author: Father Chrysostomos <spr...@cpan.org> Date: Tue Sep 28 14:50:15 2010 -0700 perldelta entry for [perl #78058] qr/\88/ hangs M pod/perldelta.pod commit ca67da414cee8e3361276f1f6268ca488126da08 Author: Karl Williamson <pub...@khwilliamson.com> Date: Tue Sep 28 14:44:08 2010 -0600 regcomp.c [perl #78058] qr/\18/ loops This patch restores the behavior of /\18/ to mean /\0018/, which was inadvertently changed by c99e91e919b4bb89bab7829a9026ee01b1fff2a1. This bug happens when t the first digit is [1-9], and the second [89]. M regcomp.c M t/re/re.t ----------------------------------------------------------------------- Summary of changes: pod/perldelta.pod | 9 +++++++++ regcomp.c | 2 +- t/re/re.t | 9 +++++++-- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/pod/perldelta.pod b/pod/perldelta.pod index 73a90d2..0eea356 100644 --- a/pod/perldelta.pod +++ b/pod/perldelta.pod @@ -637,6 +637,15 @@ L<[perl #75154]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=75154>. Assignment through a glob no longer triggers set-magic on the glob itself L<[perl #77928]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=77928>. +=item * + +The regular expression parser no longer hangs when parsing C<\18> and +C<\88>. + +This bug was introduced in version 5.13.5 and did not affect earlier +versions +L<[perl #78058]|http://rt.perl.org/rt3/Public/Bug/Display.html?id=78058>. + =back =head1 Known Problems diff --git a/regcomp.c b/regcomp.c index ff9f87b..bcdc65f 100644 --- a/regcomp.c +++ b/regcomp.c @@ -7601,7 +7601,7 @@ tryagain: case '0': case '1': case '2': case '3':case '4': case '5': case '6': case '7': case '8':case '9': if (*p == '0' || - (isOCTAL(p[1]) && atoi(p) >= RExC_npar)) + (isDIGIT(p[1]) && atoi(p) >= RExC_npar)) { I32 flags = PERL_SCAN_SILENT_ILLDIGIT; STRLEN numlen = 3; diff --git a/t/re/re.t b/t/re/re.t index 76835f0..ecbcb29 100644 --- a/t/re/re.t +++ b/t/re/re.t @@ -53,13 +53,18 @@ if ('1234'=~/(?:(?<A>\d)|(?<C>!))(?<B>\d)(?<A>\d)(?<B>\d)/){ is(regnames_count(),3); } - { # Keep this test last, as whole script will be interrupted if times out + { # Keep these tests last, as whole script will be interrupted if times out # Bug #72998; this can loop watchdog(2); eval '"\x{100}\x{FB00}" =~ /\x{100}\N{U+66}+/i'; pass("Didn't loop"); + + # Bug #78058; this can loop + watchdog(2); + eval 'qr/\18/'; + pass("qr/\18/ didn't loop"); } # New tests above this line, don't forget to update the test count below! -BEGIN { plan tests => 19 } +BEGIN { plan tests => 20 } # No tests here! -- Perl5 Master Repository