/[pcre]/code/trunk/pcre_exec.c
ViewVC logotype

Diff of /code/trunk/pcre_exec.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 482 by ph10, Mon Jan 4 15:55:46 2010 UTC revision 500 by ph10, Sat Mar 6 19:00:29 2010 UTC
# Line 1070  for (;;) Line 1070  for (;;)
1070        memmove(md->offset_vector, rec->offset_save,        memmove(md->offset_vector, rec->offset_save,
1071          rec->saved_max * sizeof(int));          rec->saved_max * sizeof(int));
1072        offset_top = rec->save_offset_top;        offset_top = rec->save_offset_top;
       mstart = rec->save_start;  
1073        ims = original_ims;        ims = original_ims;
1074        ecode = rec->after_call;        ecode = rec->after_call;
1075        break;        break;
# Line 1114  for (;;) Line 1113  for (;;)
1113        {        {
1114        RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims, NULL, 0,        RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims, NULL, 0,
1115          RM4);          RM4);
1116        if (rrc == MATCH_MATCH) break;        if (rrc == MATCH_MATCH)
1117            {
1118            mstart = md->start_match_ptr;   /* In case \K reset it */
1119            break;
1120            }
1121        if (rrc != MATCH_NOMATCH && rrc != MATCH_THEN) RRETURN(rrc);        if (rrc != MATCH_NOMATCH && rrc != MATCH_THEN) RRETURN(rrc);
1122        ecode += GET(ecode, 1);        ecode += GET(ecode, 1);
1123        }        }
# Line 1267  for (;;) Line 1270  for (;;)
1270    
1271        memcpy(new_recursive.offset_save, md->offset_vector,        memcpy(new_recursive.offset_save, md->offset_vector,
1272              new_recursive.saved_max * sizeof(int));              new_recursive.saved_max * sizeof(int));
       new_recursive.save_start = mstart;  
1273        new_recursive.save_offset_top = offset_top;        new_recursive.save_offset_top = offset_top;
       mstart = eptr;  
1274    
1275        /* OK, now we can do the recursion. For each top-level alternative we        /* OK, now we can do the recursion. For each top-level alternative we
1276        restore the offset and recursion data. */        restore the offset and recursion data. */
# Line 1316  for (;;) Line 1317  for (;;)
1317      a move back into the brackets. Friedl calls these "atomic" subpatterns.      a move back into the brackets. Friedl calls these "atomic" subpatterns.
1318      Check the alternative branches in turn - the matching won't pass the KET      Check the alternative branches in turn - the matching won't pass the KET
1319      for this kind of subpattern. If any one branch matches, we carry on as at      for this kind of subpattern. If any one branch matches, we carry on as at
1320      the end of a normal bracket, leaving the subject pointer. */      the end of a normal bracket, leaving the subject pointer, but resetting
1321        the start-of-match value in case it was changed by \K. */
1322    
1323      case OP_ONCE:      case OP_ONCE:
1324      prev = ecode;      prev = ecode;
# Line 1325  for (;;) Line 1327  for (;;)
1327      do      do
1328        {        {
1329        RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims, eptrb, 0, RM7);        RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims, eptrb, 0, RM7);
1330        if (rrc == MATCH_MATCH) break;        if (rrc == MATCH_MATCH)
1331            {
1332            mstart = md->start_match_ptr;
1333            break;
1334            }
1335        if (rrc != MATCH_NOMATCH && rrc != MATCH_THEN) RRETURN(rrc);        if (rrc != MATCH_NOMATCH && rrc != MATCH_THEN) RRETURN(rrc);
1336        ecode += GET(ecode,1);        ecode += GET(ecode,1);
1337        }        }
# Line 1444  for (;;) Line 1450  for (;;)
1450        }        }
1451      else saved_eptr = NULL;      else saved_eptr = NULL;
1452    
1453      /* If we are at the end of an assertion group, stop matching and return      /* If we are at the end of an assertion group or an atomic group, stop
1454      MATCH_MATCH, but record the current high water mark for use by positive      matching and return MATCH_MATCH, but record the current high water mark for
1455      assertions. Do this also for the "once" (atomic) groups. */      use by positive assertions. We also need to record the match start in case
1456        it was changed by \K. */
1457    
1458      if (*prev == OP_ASSERT || *prev == OP_ASSERT_NOT ||      if (*prev == OP_ASSERT || *prev == OP_ASSERT_NOT ||
1459          *prev == OP_ASSERTBACK || *prev == OP_ASSERTBACK_NOT ||          *prev == OP_ASSERTBACK || *prev == OP_ASSERTBACK_NOT ||
# Line 1454  for (;;) Line 1461  for (;;)
1461        {        {
1462        md->end_match_ptr = eptr;      /* For ONCE */        md->end_match_ptr = eptr;      /* For ONCE */
1463        md->end_offset_top = offset_top;        md->end_offset_top = offset_top;
1464          md->start_match_ptr = mstart;
1465        RRETURN(MATCH_MATCH);        RRETURN(MATCH_MATCH);
1466        }        }
1467    
# Line 1490  for (;;) Line 1498  for (;;)
1498          recursion_info *rec = md->recursive;          recursion_info *rec = md->recursive;
1499          DPRINTF(("Recursion (%d) succeeded - continuing\n", number));          DPRINTF(("Recursion (%d) succeeded - continuing\n", number));
1500          md->recursive = rec->prevrec;          md->recursive = rec->prevrec;
         mstart = rec->save_start;  
1501          memcpy(md->offset_vector, rec->offset_save,          memcpy(md->offset_vector, rec->offset_save,
1502            rec->saved_max * sizeof(int));            rec->saved_max * sizeof(int));
1503          offset_top = rec->save_offset_top;          offset_top = rec->save_offset_top;

Legend:
Removed from v.482  
changed lines
  Added in v.500

  ViewVC Help
Powered by ViewVC 1.1.5