This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
CPAN.pm 1.9205
[perl5.git] / regexec.c
index b05a177..1b9fca1 100644 (file)
--- a/regexec.c
+++ b/regexec.c
@@ -1481,8 +1481,8 @@ S_find_byclass(pTHX_ regexp * prog, const regnode *c, char *s,
                U8 **points; /* map of where we were in the input string
                                when reading a given char. For ASCII this
                                is unnecessary overhead as the relationship
-                               is always 1:1, but for unicode, especially
-                               case folded unicode this is not true. */
+                               is always 1:1, but for Unicode, especially
+                               case folded Unicode this is not true. */
                U8 foldbuf[ UTF8_MAXBYTES_CASE + 1 ];
                U8 *bitmap=NULL;
 
@@ -2937,7 +2937,7 @@ S_regmatch(pTHX_ regmatch_info *reginfo, regnode *prog)
                    if ( got_wordnum ) {
                        if ( ! ST.accepted ) {
                            ENTER;
-                           SAVETMPS;
+                           /* SAVETMPS; */ /* XXX is this necessary? dmq */
                            bufflen = TRIE_INITAL_ACCEPT_BUFFLEN;
                            sv_accept_buff=newSV(bufflen *
                                            sizeof(reg_trie_accepted) - 1);
@@ -3148,18 +3148,10 @@ S_regmatch(pTHX_ regmatch_info *reginfo, regnode *prog)
                PL_reginput = (char *)ST.accept_buff[ best ].endpos;
                if ( !ST.jump || !ST.jump[ST.accept_buff[best].wordnum]) {
                    scan = ST.B;
-                   /* NOTREACHED */
                } else {
                    scan = ST.me + ST.jump[ST.accept_buff[best].wordnum];
-                   /* NOTREACHED */
-                }
-                if (has_cutgroup) {
-                    PUSH_YES_STATE_GOTO(TRIE_next, scan);    
-                    /* NOTREACHED */
-                } else {
-                    PUSH_STATE_GOTO(TRIE_next, scan);
-                    /* NOTREACHED */
                 }
+                PUSH_YES_STATE_GOTO(TRIE_next, scan);    
                 /* NOTREACHED */
            }
            /* NOTREACHED */
@@ -4219,12 +4211,6 @@ NULL
 
        case BRANCH:        /*  /(...|A|...)/ */
            scan = NEXTOPER(scan); /* scan now points to inner node */
-           if ((!next || (OP(next) != BRANCH && OP(next) != BRANCHJ)) 
-               && !has_cutgroup)
-           {
-               /* last branch; skip state push and jump direct to node */
-               continue;
-            }
            ST.lastparen = *PL_reglastparen;
            ST.next_branch = next;
            REGCP_SET(ST.cp);
@@ -5419,8 +5405,8 @@ S_regrepeat(pTHX_ const regexp *prog, const regnode *p, I32 max, int depth)
        } else {
            while (scan < loceol && !isSPACE(*scan))
                scan++;
-           break;
        }
+       break;
     case NSPACEL:
        PL_reg_flags |= RF_tainted;
        if (do_utf8) {
@@ -5586,8 +5572,8 @@ Perl_regclass_swash(pTHX_ const regexp *prog, register const regnode* node, bool
             * documentation of these array elements. */
 
            si = *ary;
-           a  = SvROK(ary[1]) ? &ary[1] : 0;
-           b  = SvTYPE(ary[2]) == SVt_PVAV ? &ary[2] : 0;
+           a  = SvROK(ary[1]) ? &ary[1] : NULL;
+           b  = SvTYPE(ary[2]) == SVt_PVAV ? &ary[2] : NULL;
 
            if (a)
                sw = *a;