/[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 1376 by ph10, Sat Oct 12 18:02:11 2013 UTC revision 1379 by ph10, Mon Oct 14 13:54:07 2013 UTC
# Line 107  because the offset vector is always a mu Line 107  because the offset vector is always a mu
107    
108  /* Min and max values for the common repeats; for the maxima, 0 => infinity */  /* Min and max values for the common repeats; for the maxima, 0 => infinity */
109    
110  static const char rep_min[] = { 0, 0, 1, 1, 0, 0 };  static const char rep_min[] = { 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, };
111  static const char rep_max[] = { 0, 0, 0, 0, 1, 1 };  static const char rep_max[] = { 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, };
112    
113  #ifdef PCRE_DEBUG  #ifdef PCRE_DEBUG
114  /*************************************************  /*************************************************
# Line 2864  for (;;) Line 2864  for (;;)
2864          case OP_CRMINPLUS:          case OP_CRMINPLUS:
2865          case OP_CRQUERY:          case OP_CRQUERY:
2866          case OP_CRMINQUERY:          case OP_CRMINQUERY:
2867            case OP_CRPOSSTAR:
2868            case OP_CRPOSPLUS:
2869            case OP_CRPOSQUERY:
2870          c = *ecode++ - OP_CRSTAR;          c = *ecode++ - OP_CRSTAR;
2871          minimize = (c & 1) != 0;          if (c < OP_CRPOSSTAR - OP_CRSTAR) minimize = (c & 1) != 0;
2872            else possessive = TRUE;
2873          min = rep_min[c];                 /* Pick up values from tables; */          min = rep_min[c];                 /* Pick up values from tables; */
2874          max = rep_max[c];                 /* zero for max => infinity */          max = rep_max[c];                 /* zero for max => infinity */
2875          if (max == 0) max = INT_MAX;          if (max == 0) max = INT_MAX;
# Line 2873  for (;;) Line 2877  for (;;)
2877    
2878          case OP_CRRANGE:          case OP_CRRANGE:
2879          case OP_CRMINRANGE:          case OP_CRMINRANGE:
2880            case OP_CRPOSRANGE:
2881          minimize = (*ecode == OP_CRMINRANGE);          minimize = (*ecode == OP_CRMINRANGE);
2882            possessive = (*ecode == OP_CRPOSRANGE);
2883          min = GET2(ecode, 1);          min = GET2(ecode, 1);
2884          max = GET2(ecode, 1 + IMM2_SIZE);          max = GET2(ecode, 1 + IMM2_SIZE);
2885          if (max == 0) max = INT_MAX;          if (max == 0) max = INT_MAX;
# Line 3015  for (;;) Line 3021  for (;;)
3021                if ((BYTE_MAP[c/8] & (1 << (c&7))) == 0) break;                if ((BYTE_MAP[c/8] & (1 << (c&7))) == 0) break;
3022              eptr += len;              eptr += len;
3023              }              }
3024    
3025              if (possessive) continue;    /* No backtracking */
3026    
3027            for (;;)            for (;;)
3028              {              {
3029              RMATCH(eptr, ecode, offset_top, md, eptrb, RM18);              RMATCH(eptr, ecode, offset_top, md, eptrb, RM18);
# Line 3045  for (;;) Line 3054  for (;;)
3054                if ((BYTE_MAP[c/8] & (1 << (c&7))) == 0) break;                if ((BYTE_MAP[c/8] & (1 << (c&7))) == 0) break;
3055              eptr++;              eptr++;
3056              }              }
3057    
3058              if (possessive) continue;    /* No backtracking */
3059    
3060            while (eptr >= pp)            while (eptr >= pp)
3061              {              {
3062              RMATCH(eptr, ecode, offset_top, md, eptrb, RM19);              RMATCH(eptr, ecode, offset_top, md, eptrb, RM19);
# Line 3078  for (;;) Line 3090  for (;;)
3090          case OP_CRMINPLUS:          case OP_CRMINPLUS:
3091          case OP_CRQUERY:          case OP_CRQUERY:
3092          case OP_CRMINQUERY:          case OP_CRMINQUERY:
3093            case OP_CRPOSSTAR:
3094            case OP_CRPOSPLUS:
3095            case OP_CRPOSQUERY:
3096          c = *ecode++ - OP_CRSTAR;          c = *ecode++ - OP_CRSTAR;
3097          minimize = (c & 1) != 0;          if (c < OP_CRPOSSTAR - OP_CRSTAR) minimize = (c & 1) != 0;
3098            else possessive = TRUE;
3099          min = rep_min[c];                 /* Pick up values from tables; */          min = rep_min[c];                 /* Pick up values from tables; */
3100          max = rep_max[c];                 /* zero for max => infinity */          max = rep_max[c];                 /* zero for max => infinity */
3101          if (max == 0) max = INT_MAX;          if (max == 0) max = INT_MAX;
# Line 3087  for (;;) Line 3103  for (;;)
3103    
3104          case OP_CRRANGE:          case OP_CRRANGE:
3105          case OP_CRMINRANGE:          case OP_CRMINRANGE:
3106            case OP_CRPOSRANGE:
3107          minimize = (*ecode == OP_CRMINRANGE);          minimize = (*ecode == OP_CRMINRANGE);
3108            possessive = (*ecode == OP_CRPOSRANGE);
3109          min = GET2(ecode, 1);          min = GET2(ecode, 1);
3110          max = GET2(ecode, 1 + IMM2_SIZE);          max = GET2(ecode, 1 + IMM2_SIZE);
3111          if (max == 0) max = INT_MAX;          if (max == 0) max = INT_MAX;
# Line 3159  for (;;) Line 3177  for (;;)
3177            if (!PRIV(xclass)(c, data, utf)) break;            if (!PRIV(xclass)(c, data, utf)) break;
3178            eptr += len;            eptr += len;
3179            }            }
3180    
3181            if (possessive) continue;    /* No backtracking */
3182    
3183          for(;;)          for(;;)
3184            {            {
3185            RMATCH(eptr, ecode, offset_top, md, eptrb, RM21);            RMATCH(eptr, ecode, offset_top, md, eptrb, RM21);

Legend:
Removed from v.1376  
changed lines
  Added in v.1379

  ViewVC Help
Powered by ViewVC 1.1.5