In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/75451d8cc625c69a543f2bacf2312d369f8855ae?hp=d547f0460acfc3402149384c6eff4f32c8370088>

- Log -----------------------------------------------------------------
commit 75451d8cc625c69a543f2bacf2312d369f8855ae
Author: Karl Williamson <[email protected]>
Date:   Sat Feb 16 09:50:33 2019 -0700

    PATCH: [perl #133767] Assertion failure
    
    The problem here is that a syntax error occurs and hence certain things
    don't get done, but processing continues, as the error isn't checked for
    until after the return of the function that found it.  The failing
    assertion is checking that those certain things actually did get done.
    
    There appear to be good reasons to defer the raising of the error until
    then, so the simplest way to fix this is to generalize the code so that
    the failing assertion doesn't happen.

-----------------------------------------------------------------------

Summary of changes:
 pod/perldelta.pod | 5 +++++
 regcomp.c         | 9 +++++++--
 t/re/reg_mesg.t   | 1 +
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/pod/perldelta.pod b/pod/perldelta.pod
index 74c9bdf799..75bf63e370 100644
--- a/pod/perldelta.pod
+++ b/pod/perldelta.pod
@@ -382,6 +382,11 @@ the same property as another simultaneously.  These have 
now been fixed.
 
 =back
 
+=item * Assertion failure in compiling invalid regex pattern [perl #133767]
+
+This bug was introduced in the 5.29 series, so this should not be in the
+perldelta for 5.30.
+
 =back
 
 =head1 Acknowledgements
diff --git a/regcomp.c b/regcomp.c
index 088b1df7cd..387126e94f 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -18178,8 +18178,13 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state, I32 
*flagp, U32 depth,
              * the only element in the character class (perluniprops.pod notes
              * such properties). */
             if (partial_cp_count == 0) {
-                assert (! invert);
-                ret = reganode(pRExC_state, OPFAIL, 0);
+                if (invert) {
+                    ret = reg_node(pRExC_state, SANY);
+                }
+                else {
+                    ret = reganode(pRExC_state, OPFAIL, 0);
+                }
+
                 goto not_anyof;
             }
 
diff --git a/t/re/reg_mesg.t b/t/re/reg_mesg.t
index 13a37b534b..5d88fe745f 100644
--- a/t/re/reg_mesg.t
+++ b/t/re/reg_mesg.t
@@ -313,6 +313,7 @@ my @death =
  '/(?<=/' => 'Sequence (?... not terminated {#} m/(?<={#}/',                   
     # [perl #128170]
  '/\p{vertical  tab}/' => 'Can\'t find Unicode property definition "vertical 
 tab" {#} m/\\p{vertical  tab}{#}/', # [perl #132055]
  "/$bug133423/" => "Operand with no preceding operator {#} m/(?[(?^:(?[\\
+ '/[^/' => 'Unmatched [ {#} m/[{#}^/', # [perl #133767]
 
 );
 

-- 
Perl5 Master Repository

Reply via email to