This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
More generalized fix for #127855, overallocate in SvGROW and not just sv_grow()
[perl5.git] / regcomp.c
index f8dc8a1..be6cb96 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -933,7 +933,7 @@ Perl_re_indentf(pTHX_ const char *fmt, U32 depth, ...)
     PerlIO *f= Perl_debug_log;
     PERL_ARGS_ASSERT_RE_INDENTF;
     va_start(ap, depth);
-    PerlIO_printf(f, "%*s", ( depth % 20 ) * 2, "");
+    PerlIO_printf(f, "%*s", ( (int)depth % 20 ) * 2, "");
     result = PerlIO_vprintf(f, fmt, ap);
     va_end(ap);
     return result;
@@ -2166,7 +2166,8 @@ S_dump_trie_interim_table(pTHX_ const struct _reg_trie_data *trie,
         }
     }
 
-    Perl_re_printf( aTHX_  "\n%*sState+-",depth+1 );
+    Perl_re_printf( aTHX_ "\n");
+    Perl_re_indentf( aTHX_  "State+-", depth+1 );
 
     for( charid=0 ; charid < trie->uniquecharcount ; charid++ ) {
         Perl_re_printf( aTHX_  "%.*s", colwidth,"--------");
@@ -14547,9 +14548,9 @@ S_handle_regex_sets(pTHX_ RExC_state_t *pRExC_state, SV** return_invlist,
                                        'stack' of where the undealt-with left
                                        parens would be if they were actually
                                        put there */
-    /* The 'volatile' is a workaround for an optimiser bug
+    /* The 'VOL' (expanding to 'volatile') is a workaround for an optimiser bug
      * in Solaris Studio 12.3. See RT #127455 */
-    volatile IV fence = 0;          /* Position of where most recent undealt-
+    VOL IV fence = 0;               /* Position of where most recent undealt-
                                        with left paren in stack is; -1 if none.
                                      */
     STRLEN len;                     /* Temporary */
@@ -20039,14 +20040,7 @@ S_put_charclass_bitmap_innards(pTHX_ SV *sv,
             /* And this flag for matching all non-ASCII 0xFF and below */
             if (flags & ANYOF_SHARED_d_MATCHES_ALL_NON_UTF8_NON_ASCII_non_d_WARN_SUPER)
             {
-                if (invert) {
-                    not_utf8 = _new_invlist(0);
-                }
-                else {
-                    not_utf8 = invlist_clone(PL_UpperLatin1);
-                }
-                inverting_allowed = FALSE;  /* XXX needs more work to be able
-                                               to allow this */
+                not_utf8 = invlist_clone(PL_UpperLatin1);
             }
         }
         else if (OP(node) == ANYOFL) {
@@ -20148,6 +20142,7 @@ S_put_charclass_bitmap_innards(pTHX_ SV *sv,
          * conditional code points, so that when inverted, they will be gone
          * from it */
         _invlist_union(only_utf8, invlist, &invlist);
+        _invlist_union(not_utf8, invlist, &invlist);
         _invlist_union(only_utf8_locale, invlist, &invlist);
         _invlist_invert(invlist);
         _invlist_intersection(invlist, PL_InBitmap, &invlist);