In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/c0755d0f10aaf12573eabf0bd12a4aa182802211?hp=af2f850fb5b3bd37dab6742ca16cce6aa5482fb9>

- Log -----------------------------------------------------------------
commit c0755d0f10aaf12573eabf0bd12a4aa182802211
Author: Karl Williamson <k...@cpan.org>
Date:   Mon Oct 19 23:00:40 2015 -0600

    perldelta for #126404

M       pod/perldelta.pod

commit 9457bb3f08028eb92e8c712a484c94d427c6009a
Author: Karl Williamson <k...@cpan.org>
Date:   Mon Oct 19 22:51:53 2015 -0600

    PATCH: [perl #12406] regnode panic
    
    This was due to an "=" that should have been a "+=", which ended up in
    this situation not allocating enough space for the pattern.  This is not
    likely to cause real field problems since the generated pattern won't
    succeed, and the problem is warned about and would be corrected.

M       regcomp.c
M       t/re/pat.t
-----------------------------------------------------------------------

Summary of changes:
 pod/perldelta.pod |  3 ++-
 regcomp.c         |  2 +-
 t/re/pat.t        | 12 +++++++++++-
 3 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/pod/perldelta.pod b/pod/perldelta.pod
index c210865..56b4e98 100644
--- a/pod/perldelta.pod
+++ b/pod/perldelta.pod
@@ -420,11 +420,12 @@ L<[perl 
#116639]|https://rt.perl.org/Ticket/Display.html?id=116639>
 
 =item *
 
-A regression from Perl 5.20 has been fixed, in which some syntax errors in
+Some regressions from Perl 5.20 has been fixed, in which some syntax errors in
 L<C<(?[...])>|perlrecharclass/Extended Bracketed Character Classes> constructs
 within regular expression patterns could cause a segfault instead of a proper
 error message.
 L<[perl #126180]|https://rt.perl.org/Ticket/Display.html?id=126180>
+L<[perl #126404]|https://rt.perl.org/Ticket/Display.html?id=126404>
 
 =item *
 
diff --git a/regcomp.c b/regcomp.c
index 986d1da..540f71c 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -10940,7 +10940,7 @@ S_regpiece(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, 
U32 depth)
                      * enough space for all the things we are about to throw
                      * away, but we can shrink it by the ammount we are about
                      * to re-use here */
-                    RExC_size = PREVOPER(RExC_size) - regarglen[(U8)OPFAIL];
+                    RExC_size += PREVOPER(RExC_size) - regarglen[(U8)OPFAIL];
                 }
                 else {
                     ckWARNreg(RExC_parse, "Quantifier {n,m} with n > m can't 
match");
diff --git a/t/re/pat.t b/t/re/pat.t
index c6e9209..fb4caf6 100644
--- a/t/re/pat.t
+++ b/t/re/pat.t
@@ -23,7 +23,7 @@ BEGIN {
     skip_all_without_unicode_tables();
 }
 
-plan tests => 775;  # Update this when adding/deleting tests.
+plan tests => 776;  # Update this when adding/deleting tests.
 
 run_tests() unless caller;
 
@@ -1711,6 +1711,16 @@ EOP
                like($error, qr{Reference to nonexistent group},
                                'gave appropriate error for qr{()(?1)}n');
        }
+
+       {
+            # [perl #126406] panic with unmatchable quantifier
+            my $code='
+                no warnings "regexp";
+                "" =~ m/(.0\N{6,0}0\N{6,0}000000000000000000000000000000000)/;
+            ';
+            fresh_perl_is($code, "", {},
+                            "perl [#126406] panic");
+       }
 } # End of sub run_tests
 
 1;

--
Perl5 Master Repository

Reply via email to