Re: [ID 20010212.006] Core dump with /((?:hard|soft)cover)?/
Hugo van der Sanden [Tue, 13 Feb 2001 00:11:11 +0000 (00:11 +0000)]
Message-Id: <200102130011.AAA14310@crypt.compulink.co.uk>

p4raw-id: //depot/perl@8779

regcomp.c
t/op/re_tests

index bdcea75..547f756 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -650,21 +650,19 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp, I32 *deltap, reg
 #endif
                    n = regnext(n);
                }
-               else {
+               else if (stringok) {
                    int oldl = STR_LEN(scan);
                    regnode *nnext = regnext(n);
-               
+
                    if (oldl + STR_LEN(n) > U8_MAX)
                        break;
                    NEXT_OFF(scan) += NEXT_OFF(n);
                    STR_LEN(scan) += STR_LEN(n);
                    next = n + NODE_SZ_STR(n);
                    /* Now we can overwrite *n : */
-                   Move(STRING(n), STRING(scan) + oldl,
-                        STR_LEN(n), char);
+                   Move(STRING(n), STRING(scan) + oldl, STR_LEN(n), char);
 #ifdef DEBUGGING
-                   if (stringok)
-                       stop = next - 1;
+                   stop = next - 1;
 #endif
                    n = nnext;
                }
index 1090e11..6477d67 100644 (file)
@@ -782,3 +782,5 @@ tt+$        xxxtt   y       -       -
 ^(b+?|a){1,2}c bbbac   y       $1      a
 ^(b+?|a){1,2}c bbbbac  y       $1      a
 \((\w\. \w+)\) cd. (A. Tw)     y       -$1-    -A. Tw-
+((?:aaaa|bbbb)cccc)?   aaaacccc        y       -       -
+((?:aaaa|bbbb)cccc)?   bbbbcccc        y       -       -