/[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 630 by ph10, Fri Jul 22 10:00:10 2011 UTC revision 642 by ph10, Thu Jul 28 18:59:40 2011 UTC
# Line 1501  for (;;) Line 1501  for (;;)
1501    
1502      case OP_RECURSE:      case OP_RECURSE:
1503        {        {
1504          recursion_info *ri;
1505          int recno;
1506    
1507        callpat = md->start_code + GET(ecode, 1);        callpat = md->start_code + GET(ecode, 1);
1508        new_recursive.group_num = (callpat == md->start_code)? 0 :        recno = (callpat == md->start_code)? 0 :
1509          GET2(callpat, 1 + LINK_SIZE);          GET2(callpat, 1 + LINK_SIZE);
1510    
1511          /* Check for repeating a recursion without advancing the subject pointer.
1512          This should catch convoluted mutual recursions. (Some simple cases are
1513          caught at compile time.) */
1514    
1515          for (ri = md->recursive; ri != NULL; ri = ri->prevrec)
1516            if (recno == ri->group_num && eptr == ri->subject_position)
1517              RRETURN(PCRE_ERROR_RECURSELOOP);
1518    
1519        /* Add to "recursing stack" */        /* Add to "recursing stack" */
1520    
1521          new_recursive.group_num = recno;
1522          new_recursive.subject_position = eptr;
1523        new_recursive.prevrec = md->recursive;        new_recursive.prevrec = md->recursive;
1524        md->recursive = &new_recursive;        md->recursive = &new_recursive;
1525    

Legend:
Removed from v.630  
changed lines
  Added in v.642

  ViewVC Help
Powered by ViewVC 1.1.5