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

Diff of /code/trunk/pcre_compile.c

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

revision 1477 by ph10, Wed May 21 17:53:49 2014 UTC revision 1480 by ph10, Tue May 27 18:02:51 2014 UTC
# Line 3076  const pcre_uint8 *class_bitset; Line 3076  const pcre_uint8 *class_bitset;
3076  const pcre_uint8 *set1, *set2, *set_end;  const pcre_uint8 *set1, *set2, *set_end;
3077  pcre_uint32 chr;  pcre_uint32 chr;
3078  BOOL accepted, invert_bits;  BOOL accepted, invert_bits;
3079    BOOL entered_a_group = FALSE;
3080    
3081  /* Note: the base_list[1] contains whether the current opcode has greedy  /* Note: the base_list[1] contains whether the current opcode has greedy
3082  (represented by a non-zero value) quantifier. This is a different from  (represented by a non-zero value) quantifier. This is a different from
# Line 3088  for(;;) Line 3089  for(;;)
3089    Therefore infinite recursions are not possible. */    Therefore infinite recursions are not possible. */
3090    
3091    c = *code;    c = *code;
3092    
3093    /* Skip over callouts */    /* Skip over callouts */
3094    
3095    if (c == OP_CALLOUT)    if (c == OP_CALLOUT)
# Line 3117  for(;;) Line 3118  for(;;)
3118      /* If the bracket is capturing, and referenced by an OP_RECURSE, or      /* If the bracket is capturing, and referenced by an OP_RECURSE, or
3119      it is an atomic sub-pattern (assert, once, etc.) the non-greedy case      it is an atomic sub-pattern (assert, once, etc.) the non-greedy case
3120      cannot be converted to a possessive form. */      cannot be converted to a possessive form. */
3121    
3122      if (base_list[1] == 0) return FALSE;      if (base_list[1] == 0) return FALSE;
3123    
3124      switch(*(code - GET(code, 1)))      switch(*(code - GET(code, 1)))
# Line 3129  for(;;) Line 3130  for(;;)
3130        case OP_ONCE:        case OP_ONCE:
3131        case OP_ONCE_NC:        case OP_ONCE_NC:
3132        /* Atomic sub-patterns and assertions can always auto-possessify their        /* Atomic sub-patterns and assertions can always auto-possessify their
3133        last iterator. */        last iterator. However, if the group was entered as a result of checking
3134        return TRUE;        a previous iterator, this is not possible. */
3135    
3136          return !entered_a_group;
3137        }        }
3138    
3139      code += PRIV(OP_lengths)[c];      code += PRIV(OP_lengths)[c];
# Line 3149  for(;;) Line 3152  for(;;)
3152        code = next_code + 1 + LINK_SIZE;        code = next_code + 1 + LINK_SIZE;
3153        next_code += GET(next_code, 1);        next_code += GET(next_code, 1);
3154        }        }
3155    
3156        entered_a_group = TRUE;
3157      continue;      continue;
3158    
3159      case OP_BRAZERO:      case OP_BRAZERO:
# Line 3168  for(;;) Line 3173  for(;;)
3173    
3174      code += PRIV(OP_lengths)[c];      code += PRIV(OP_lengths)[c];
3175      continue;      continue;
3176    
3177        default:
3178        break;
3179      }      }
3180    
3181    /* Check for a supported opcode, and load its properties. */    /* Check for a supported opcode, and load its properties. */
3182    
3183    code = get_chr_property_list(code, utf, cd->fcc, list);    code = get_chr_property_list(code, utf, cd->fcc, list);
3184    if (code == NULL) return FALSE;    /* Unsupported */    if (code == NULL) return FALSE;    /* Unsupported */
3185    
3186    /* If either opcode is a small character list, set pointers for comparing    /* If either opcode is a small character list, set pointers for comparing
3187    characters from that list with another list, or with a property. */    characters from that list with another list, or with a property. */
3188    
# Line 3406  for(;;) Line 3414  for(;;)
3414             rightop >= FIRST_AUTOTAB_OP && rightop <= LAST_AUTOTAB_RIGHT_OP &&             rightop >= FIRST_AUTOTAB_OP && rightop <= LAST_AUTOTAB_RIGHT_OP &&
3415             autoposstab[leftop - FIRST_AUTOTAB_OP][rightop - FIRST_AUTOTAB_OP];             autoposstab[leftop - FIRST_AUTOTAB_OP][rightop - FIRST_AUTOTAB_OP];
3416    
3417      if (!accepted)      if (!accepted) return FALSE;
3418        return FALSE;  
   
3419      if (list[1] == 0) return TRUE;      if (list[1] == 0) return TRUE;
3420      /* Might be an empty repeat. */      /* Might be an empty repeat. */
3421      continue;      continue;

Legend:
Removed from v.1477  
changed lines
  Added in v.1480

  ViewVC Help
Powered by ViewVC 1.1.5