/[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 836 by ph10, Wed Dec 28 17:16:11 2011 UTC revision 927 by ph10, Wed Feb 22 15:15:08 2012 UTC
# Line 55  supporting internal functions that are n Line 55  supporting internal functions that are n
55    
56  /* When PCRE_DEBUG is defined, we need the pcre(16)_printint() function, which  /* When PCRE_DEBUG is defined, we need the pcre(16)_printint() function, which
57  is also used by pcretest. PCRE_DEBUG is not defined when building a production  is also used by pcretest. PCRE_DEBUG is not defined when building a production
58  library. We do not need to select pcre16_printint.c specially, because the  library. We do not need to select pcre16_printint.c specially, because the
59  COMPILE_PCREx macro will already be appropriately set. */  COMPILE_PCREx macro will already be appropriately set. */
60    
61  #ifdef PCRE_DEBUG  #ifdef PCRE_DEBUG
# Line 438  static const char error_texts[] = Line 438  static const char error_texts[] =
438    /* 30 */    /* 30 */
439    "unknown POSIX class name\0"    "unknown POSIX class name\0"
440    "POSIX collating elements are not supported\0"    "POSIX collating elements are not supported\0"
441    "this version of PCRE is not compiled with PCRE_UTF8 support\0"    "this version of PCRE is compiled without UTF support\0"
442    "spare error\0"  /** DEAD **/    "spare error\0"  /** DEAD **/
443    "character value in \\x{...} sequence is too large\0"    "character value in \\x{...} sequence is too large\0"
444    /* 35 */    /* 35 */
# Line 461  static const char error_texts[] = Line 461  static const char error_texts[] =
461    "too many named subpatterns (maximum " XSTRING(MAX_NAME_COUNT) ")\0"    "too many named subpatterns (maximum " XSTRING(MAX_NAME_COUNT) ")\0"
462    /* 50 */    /* 50 */
463    "repeated subpattern is too long\0"    /** DEAD **/    "repeated subpattern is too long\0"    /** DEAD **/
464    "octal value is greater than \\377 (not in UTF-8 mode)\0"    "octal value is greater than \\377 in 8-bit non-UTF-8 mode\0"
465    "internal error: overran compiling workspace\0"    "internal error: overran compiling workspace\0"
466    "internal error: previously-checked referenced subpattern not found\0"    "internal error: previously-checked referenced subpattern not found\0"
467    "DEFINE group contains more than one branch\0"    "DEFINE group contains more than one branch\0"
# Line 480  static const char error_texts[] = Line 480  static const char error_texts[] =
480    /* 65 */    /* 65 */
481    "different names for subpatterns of the same number are not allowed\0"    "different names for subpatterns of the same number are not allowed\0"
482    "(*MARK) must have an argument\0"    "(*MARK) must have an argument\0"
483    "this version of PCRE is not compiled with PCRE_UCP support\0"    "this version of PCRE is not compiled with Unicode property support\0"
484    "\\c must be followed by an ASCII character\0"    "\\c must be followed by an ASCII character\0"
485    "\\k is not followed by a braced, angle-bracketed, or quoted name\0"    "\\k is not followed by a braced, angle-bracketed, or quoted name\0"
486    /* 70 */    /* 70 */
487    "internal error: unknown opcode in find_fixedlength()\0"    "internal error: unknown opcode in find_fixedlength()\0"
488    "\\N is not supported in a class\0"    "\\N is not supported in a class\0"
489    "too many forward references\0"    "too many forward references\0"
490    "disallowed UTF-8/16 code point (>= 0xd800 && <= 0xdfff)\0"    "disallowed Unicode code point (>= 0xd800 && <= 0xdfff)\0"
491      "invalid UTF-16 string\0"
492    ;    ;
493    
494  /* Table to identify digits and hex digits. This is used when compiling  /* Table to identify digits and hex digits. This is used when compiling
# Line 990  else Line 991  else
991      /* \0 always starts an octal number, but we may drop through to here with a      /* \0 always starts an octal number, but we may drop through to here with a
992      larger first octal digit. The original code used just to take the least      larger first octal digit. The original code used just to take the least
993      significant 8 bits of octal numbers (I think this is what early Perls used      significant 8 bits of octal numbers (I think this is what early Perls used
994      to do). Nowadays we allow for larger numbers in UTF-8 mode, but no more      to do). Nowadays we allow for larger numbers in UTF-8 mode and 16-bit mode,
995      than 3 octal digits. */      but no more than 3 octal digits. */
996    
997      case CHAR_0:      case CHAR_0:
998      c -= CHAR_0;      c -= CHAR_0;
999      while(i++ < 2 && ptr[1] >= CHAR_0 && ptr[1] <= CHAR_7)      while(i++ < 2 && ptr[1] >= CHAR_0 && ptr[1] <= CHAR_7)
1000          c = c * 8 + *(++ptr) - CHAR_0;          c = c * 8 + *(++ptr) - CHAR_0;
1001    #ifdef COMPILE_PCRE8
1002      if (!utf && c > 0xff) *errorcodeptr = ERR51;      if (!utf && c > 0xff) *errorcodeptr = ERR51;
1003    #endif
1004      break;      break;
1005    
1006      /* \x is complicated. \x{ddd} is a character number which can be greater      /* \x is complicated. \x{ddd} is a character number which can be greater
# Line 1708  for (;;) Line 1711  for (;;)
1711    int d;    int d;
1712    pcre_uchar *ce, *cs;    pcre_uchar *ce, *cs;
1713    register int op = *cc;    register int op = *cc;
1714    
1715    switch (op)    switch (op)
1716      {      {
1717      /* We only need to continue for OP_CBRA (normal capturing bracket) and      /* We only need to continue for OP_CBRA (normal capturing bracket) and
# Line 1769  for (;;) Line 1772  for (;;)
1772      case OP_ASSERTBACK_NOT:      case OP_ASSERTBACK_NOT:
1773      do cc += GET(cc, 1); while (*cc == OP_ALT);      do cc += GET(cc, 1); while (*cc == OP_ALT);
1774      cc += PRIV(OP_lengths)[*cc];      cc += PRIV(OP_lengths)[*cc];
1775      break;      break;
1776    
1777      /* Skip over things that don't match chars */      /* Skip over things that don't match chars */
1778    
# Line 2222  for (;;) Line 2225  for (;;)
2225        {        {
2226        case OP_CHAR:        case OP_CHAR:
2227        case OP_CHARI:        case OP_CHARI:
2228          case OP_NOT:
2229          case OP_NOTI:
2230        case OP_EXACT:        case OP_EXACT:
2231        case OP_EXACTI:        case OP_EXACTI:
2232          case OP_NOTEXACT:
2233          case OP_NOTEXACTI:
2234        case OP_UPTO:        case OP_UPTO:
2235        case OP_UPTOI:        case OP_UPTOI:
2236          case OP_NOTUPTO:
2237          case OP_NOTUPTOI:
2238        case OP_MINUPTO:        case OP_MINUPTO:
2239        case OP_MINUPTOI:        case OP_MINUPTOI:
2240          case OP_NOTMINUPTO:
2241          case OP_NOTMINUPTOI:
2242        case OP_POSUPTO:        case OP_POSUPTO:
2243        case OP_POSUPTOI:        case OP_POSUPTOI:
2244          case OP_NOTPOSUPTO:
2245          case OP_NOTPOSUPTOI:
2246        case OP_STAR:        case OP_STAR:
2247        case OP_STARI:        case OP_STARI:
2248          case OP_NOTSTAR:
2249          case OP_NOTSTARI:
2250        case OP_MINSTAR:        case OP_MINSTAR:
2251        case OP_MINSTARI:        case OP_MINSTARI:
2252          case OP_NOTMINSTAR:
2253          case OP_NOTMINSTARI:
2254        case OP_POSSTAR:        case OP_POSSTAR:
2255        case OP_POSSTARI:        case OP_POSSTARI:
2256          case OP_NOTPOSSTAR:
2257          case OP_NOTPOSSTARI:
2258        case OP_PLUS:        case OP_PLUS:
2259        case OP_PLUSI:        case OP_PLUSI:
2260          case OP_NOTPLUS:
2261          case OP_NOTPLUSI:
2262        case OP_MINPLUS:        case OP_MINPLUS:
2263        case OP_MINPLUSI:        case OP_MINPLUSI:
2264          case OP_NOTMINPLUS:
2265          case OP_NOTMINPLUSI:
2266        case OP_POSPLUS:        case OP_POSPLUS:
2267        case OP_POSPLUSI:        case OP_POSPLUSI:
2268          case OP_NOTPOSPLUS:
2269          case OP_NOTPOSPLUSI:
2270        case OP_QUERY:        case OP_QUERY:
2271        case OP_QUERYI:        case OP_QUERYI:
2272          case OP_NOTQUERY:
2273          case OP_NOTQUERYI:
2274        case OP_MINQUERY:        case OP_MINQUERY:
2275        case OP_MINQUERYI:        case OP_MINQUERYI:
2276          case OP_NOTMINQUERY:
2277          case OP_NOTMINQUERYI:
2278        case OP_POSQUERY:        case OP_POSQUERY:
2279        case OP_POSQUERYI:        case OP_POSQUERYI:
2280          case OP_NOTPOSQUERY:
2281          case OP_NOTPOSQUERYI:
2282        if (HAS_EXTRALEN(code[-1])) code += GET_EXTRALEN(code[-1]);        if (HAS_EXTRALEN(code[-1])) code += GET_EXTRALEN(code[-1]);
2283        break;        break;
2284        }        }
# Line 3064  if (next >= 0) switch(op_code) Line 3095  if (next >= 0) switch(op_code)
3095      }      }
3096    else    else
3097  #endif  /* SUPPORT_UTF */  #endif  /* SUPPORT_UTF */
3098    return (c != TABLE_GET(next, cd->fcc, next));  /* Non-UTF-8 mode */    return (c != TABLE_GET((unsigned int)next, cd->fcc, next));  /* Non-UTF-8 mode */
   
   /* For OP_NOT and OP_NOTI, the data is always a single-byte character. These  
   opcodes are not used for multi-byte characters, because they are coded using  
   an XCLASS instead. */  
3099    
3100    case OP_NOT:    case OP_NOT:
3101    return (c = *previous) == next;  #ifdef SUPPORT_UTF
3102      GETCHARTEST(c, previous);
3103    #else
3104      c = *previous;
3105    #endif
3106      return c == next;
3107    
3108    case OP_NOTI:    case OP_NOTI:
3109    if ((c = *previous) == next) return TRUE;  #ifdef SUPPORT_UTF
3110      GETCHARTEST(c, previous);
3111    #else
3112      c = *previous;
3113    #endif
3114      if (c == next) return TRUE;
3115  #ifdef SUPPORT_UTF  #ifdef SUPPORT_UTF
3116    if (utf)    if (utf)
3117      {      {
3118      unsigned int othercase;      unsigned int othercase;
3119      if (next < 128) othercase = cd->fcc[next]; else      if (next < 128) othercase = cd->fcc[next]; else
3120  #ifdef SUPPORT_UCP  #ifdef SUPPORT_UCP
3121      othercase = UCD_OTHERCASE(next);      othercase = UCD_OTHERCASE((unsigned int)next);
3122  #else  #else
3123      othercase = NOTACHAR;      othercase = NOTACHAR;
3124  #endif  #endif
# Line 3089  if (next >= 0) switch(op_code) Line 3126  if (next >= 0) switch(op_code)
3126      }      }
3127    else    else
3128  #endif  /* SUPPORT_UTF */  #endif  /* SUPPORT_UTF */
3129    return (c == TABLE_GET(next, cd->fcc, next));  /* Non-UTF-8 mode */    return (c == TABLE_GET((unsigned int)next, cd->fcc, next));  /* Non-UTF-8 mode */
3130    
3131    /* Note that OP_DIGIT etc. are generated only when PCRE_UCP is *not* set.    /* Note that OP_DIGIT etc. are generated only when PCRE_UCP is *not* set.
3132    When it is set, \d etc. are converted into OP_(NOT_)PROP codes. */    When it is set, \d etc. are converted into OP_(NOT_)PROP codes. */
# Line 3526  for (;; ptr++) Line 3563  for (;; ptr++)
3563      *lengthptr += (int)(code - last_code);      *lengthptr += (int)(code - last_code);
3564      DPRINTF(("length=%d added %d c=%c (0x%x)\n", *lengthptr,      DPRINTF(("length=%d added %d c=%c (0x%x)\n", *lengthptr,
3565        (int)(code - last_code), c, c));        (int)(code - last_code), c, c));
3566    
3567      /* If "previous" is set and it is not at the start of the work space, move      /* If "previous" is set and it is not at the start of the work space, move
3568      it back to there, in order to avoid filling up the work space. Otherwise,      it back to there, in order to avoid filling up the work space. Otherwise,
3569      if "previous" is NULL, reset the current code pointer to the start. */      if "previous" is NULL, reset the current code pointer to the start. */
# Line 4479  for (;; ptr++) Line 4516  for (;; ptr++)
4516        LONE_SINGLE_CHARACTER:        LONE_SINGLE_CHARACTER:
4517    
4518        /* Only the value of 1 matters for class_single_char. */        /* Only the value of 1 matters for class_single_char. */
4519    
4520        if (class_single_char < 2) class_single_char++;        if (class_single_char < 2) class_single_char++;
4521    
4522        /* If class_charcount is 1, we saw precisely one character. As long as        /* If class_charcount is 1, we saw precisely one character. As long as
4523        there were no negated characters >= 128 and there was no use of \p or \P,        there was no use of \p or \P, in other words, no use of any XCLASS
4524        in other words, no use of any XCLASS features, we can optimize.        features, we can optimize.
   
       In UTF-8 mode, we can optimize the negative case only if there were no  
       characters >= 128 because OP_NOT and the related opcodes like OP_NOTSTAR  
       operate on single-bytes characters only. This is an historical hangover.  
       Maybe one day we can tidy these opcodes to handle multi-byte characters.  
4525    
4526        The optimization throws away the bit map. We turn the item into a        The optimization throws away the bit map. We turn the item into a
4527        1-character OP_CHAR[I] if it's positive, or OP_NOT[I] if it's negative.        1-character OP_CHAR[I] if it's positive, or OP_NOT[I] if it's negative.
4528        Note that OP_NOT[I] does not support multibyte characters. In the positive        In the positive case, it can cause firstchar to be set. Otherwise, there
4529        case, it can cause firstchar to be set. Otherwise, there can be no first        can be no first char if this item is first, whatever repeat count may
4530        char if this item is first, whatever repeat count may follow. In the case        follow. In the case of reqchar, save the previous value for reinstating. */
       of reqchar, save the previous value for reinstating. */  
4531    
 #ifdef SUPPORT_UTF  
       if (class_single_char == 1 && ptr[1] == CHAR_RIGHT_SQUARE_BRACKET  
         && (!utf || !negate_class || c < (MAX_VALUE_FOR_SINGLE_CHAR + 1)))  
 #else  
4532        if (class_single_char == 1 && ptr[1] == CHAR_RIGHT_SQUARE_BRACKET)        if (class_single_char == 1 && ptr[1] == CHAR_RIGHT_SQUARE_BRACKET)
 #endif  
4533          {          {
4534          ptr++;          ptr++;
4535          zeroreqchar = reqchar;          zeroreqchar = reqchar;
4536    
         /* The OP_NOT[I] opcodes work on single characters only. */  
   
4537          if (negate_class)          if (negate_class)
4538            {            {
4539            if (firstchar == REQ_UNSET) firstchar = REQ_NONE;            if (firstchar == REQ_UNSET) firstchar = REQ_NONE;
4540            zerofirstchar = firstchar;            zerofirstchar = firstchar;
4541            *code++ = ((options & PCRE_CASELESS) != 0)? OP_NOTI: OP_NOT;            *code++ = ((options & PCRE_CASELESS) != 0)? OP_NOTI: OP_NOT;
4542            *code++ = c;  #ifdef SUPPORT_UTF
4543              if (utf && c > MAX_VALUE_FOR_SINGLE_CHAR)
4544                code += PRIV(ord2utf)(c, code);
4545              else
4546    #endif
4547                *code++ = c;
4548            goto NOT_CHAR;            goto NOT_CHAR;
4549            }            }
4550    
# Line 4550  for (;; ptr++) Line 4580  for (;; ptr++)
4580  #ifdef SUPPORT_UTF  #ifdef SUPPORT_UTF
4581  #ifndef COMPILE_PCRE8  #ifndef COMPILE_PCRE8
4582          /* In non 8 bit mode, we can get here even if we are not in UTF mode. */          /* In non 8 bit mode, we can get here even if we are not in UTF mode. */
4583          if (!utf)          if (!utf)
4584            *class_uchardata++ = c;            *class_uchardata++ = c;
4585          else          else
4586  #endif  #endif
# Line 4568  for (;; ptr++) Line 4598  for (;; ptr++)
4598  #endif  #endif
4599            {            {
4600            unsigned int othercase;            unsigned int othercase;
4601            if ((othercase = UCD_OTHERCASE(c)) != c)            if ((int)(othercase = UCD_OTHERCASE(c)) != c)
4602              {              {
4603              *class_uchardata++ = XCL_SINGLE;              *class_uchardata++ = XCL_SINGLE;
4604              class_uchardata += PRIV(ord2utf)(othercase, class_uchardata);              class_uchardata += PRIV(ord2utf)(othercase, class_uchardata);
# Line 4772  for (;; ptr++) Line 4802  for (;; ptr++)
4802    
4803      /* Now handle repetition for the different types of item. */      /* Now handle repetition for the different types of item. */
4804    
4805      /* If previous was a character match, abolish the item and generate a      /* If previous was a character or negated character match, abolish the item
4806      repeat item instead. If a char item has a minumum of more than one, ensure      and generate a repeat item instead. If a char item has a minimum of more
4807      that it is set in reqchar - it might not be if a sequence such as x{3} is      than one, ensure that it is set in reqchar - it might not be if a sequence
4808      the first thing in a branch because the x will have gone into firstchar      such as x{3} is the first thing in a branch because the x will have gone
4809      instead.  */      into firstchar instead.  */
4810    
4811      if (*previous == OP_CHAR || *previous == OP_CHARI)      if (*previous == OP_CHAR || *previous == OP_CHARI
4812        {          || *previous == OP_NOT || *previous == OP_NOTI)
4813        op_type = (*previous == OP_CHAR)? 0 : OP_STARI - OP_STAR;        {
4814          switch (*previous)
4815            {
4816            default: /* Make compiler happy. */
4817            case OP_CHAR:  op_type = OP_STAR - OP_STAR; break;
4818            case OP_CHARI: op_type = OP_STARI - OP_STAR; break;
4819            case OP_NOT:   op_type = OP_NOTSTAR - OP_STAR; break;
4820            case OP_NOTI:  op_type = OP_NOTSTARI - OP_STAR; break;
4821            }
4822    
4823        /* Deal with UTF characters that take up more than one character. It's        /* Deal with UTF characters that take up more than one character. It's
4824        easier to write this out separately than try to macrify it. Use c to        easier to write this out separately than try to macrify it. Use c to
# Line 4803  for (;; ptr++) Line 4841  for (;; ptr++)
4841        with UTF disabled, or for a single character UTF character. */        with UTF disabled, or for a single character UTF character. */
4842          {          {
4843          c = code[-1];          c = code[-1];
4844          if (repeat_min > 1) reqchar = c | req_caseopt | cd->req_varyopt;          if (*previous <= OP_CHARI && repeat_min > 1)
4845              reqchar = c | req_caseopt | cd->req_varyopt;
4846          }          }
4847    
4848        /* If the repetition is unlimited, it pays to see if the next thing on        /* If the repetition is unlimited, it pays to see if the next thing on
# Line 4822  for (;; ptr++) Line 4861  for (;; ptr++)
4861        goto OUTPUT_SINGLE_REPEAT;   /* Code shared with single character types */        goto OUTPUT_SINGLE_REPEAT;   /* Code shared with single character types */
4862        }        }
4863    
     /* If previous was a single negated character ([^a] or similar), we use  
     one of the special opcodes, replacing it. The code is shared with single-  
     character repeats by setting opt_type to add a suitable offset into  
     repeat_type. We can also test for auto-possessification. OP_NOT and OP_NOTI  
     are currently used only for single-byte chars. */  
   
     else if (*previous == OP_NOT || *previous == OP_NOTI)  
       {  
       op_type = ((*previous == OP_NOT)? OP_NOTSTAR : OP_NOTSTARI) - OP_STAR;  
       c = previous[1];  
       if (!possessive_quantifier &&  
           repeat_max < 0 &&  
           check_auto_possessive(previous, utf, ptr + 1, options, cd))  
         {  
         repeat_type = 0;    /* Force greedy */  
         possessive_quantifier = TRUE;  
         }  
       goto OUTPUT_SINGLE_REPEAT;  
       }  
   
4864      /* If previous was a character type match (\d or similar), abolish it and      /* If previous was a character type match (\d or similar), abolish it and
4865      create a suitable repeat item. The code is shared with single-character      create a suitable repeat item. The code is shared with single-character
4866      repeats by setting op_type to add a suitable offset into repeat_type. Note      repeats by setting op_type to add a suitable offset into repeat_type. Note
# Line 7560  PCRE_EXP_DEFN pcre * PCRE_CALL_CONVENTIO Line 7579  PCRE_EXP_DEFN pcre * PCRE_CALL_CONVENTIO
7579  pcre_compile(const char *pattern, int options, const char **errorptr,  pcre_compile(const char *pattern, int options, const char **errorptr,
7580    int *erroroffset, const unsigned char *tables)    int *erroroffset, const unsigned char *tables)
7581  #else  #else
7582  PCRE_EXP_DEFN pcre * PCRE_CALL_CONVENTION  PCRE_EXP_DEFN pcre16 * PCRE_CALL_CONVENTION
7583  pcre16_compile(PCRE_SPTR16 pattern, int options, const char **errorptr,  pcre16_compile(PCRE_SPTR16 pattern, int options, const char **errorptr,
7584    int *erroroffset, const unsigned char *tables)    int *erroroffset, const unsigned char *tables)
7585  #endif  #endif
# Line 7578  PCRE_EXP_DEFN pcre * PCRE_CALL_CONVENTIO Line 7597  PCRE_EXP_DEFN pcre * PCRE_CALL_CONVENTIO
7597  pcre_compile2(const char *pattern, int options, int *errorcodeptr,  pcre_compile2(const char *pattern, int options, int *errorcodeptr,
7598    const char **errorptr, int *erroroffset, const unsigned char *tables)    const char **errorptr, int *erroroffset, const unsigned char *tables)
7599  #else  #else
7600  PCRE_EXP_DEFN pcre * PCRE_CALL_CONVENTION  PCRE_EXP_DEFN pcre16 * PCRE_CALL_CONVENTION
7601  pcre16_compile2(PCRE_SPTR16 pattern, int options, int *errorcodeptr,  pcre16_compile2(PCRE_SPTR16 pattern, int options, int *errorcodeptr,
7602    const char **errorptr, int *erroroffset, const unsigned char *tables)    const char **errorptr, int *erroroffset, const unsigned char *tables)
7603  #endif  #endif
7604  {  {
7605  real_pcre *re;  REAL_PCRE *re;
7606  int length = 1;  /* For final END opcode */  int length = 1;  /* For final END opcode */
7607  pcre_int32 firstchar, reqchar;  pcre_int32 firstchar, reqchar;
7608  int newline;  int newline;
# Line 7706  not used here. */ Line 7725  not used here. */
7725  if (utf && (options & PCRE_NO_UTF8_CHECK) == 0 &&  if (utf && (options & PCRE_NO_UTF8_CHECK) == 0 &&
7726       (errorcode = PRIV(valid_utf)((PCRE_PUCHAR)pattern, -1, erroroffset)) != 0)       (errorcode = PRIV(valid_utf)((PCRE_PUCHAR)pattern, -1, erroroffset)) != 0)
7727    {    {
7728    #ifdef COMPILE_PCRE8
7729    errorcode = ERR44;    errorcode = ERR44;
7730    #else
7731      errorcode = ERR74;
7732    #endif
7733    goto PCRE_EARLY_ERROR_RETURN2;    goto PCRE_EARLY_ERROR_RETURN2;
7734    }    }
7735  #else  #else
# Line 7841  externally provided function. Integer ov Line 7864  externally provided function. Integer ov
7864  because nowadays we limit the maximum value of cd->names_found and  because nowadays we limit the maximum value of cd->names_found and
7865  cd->name_entry_size. */  cd->name_entry_size. */
7866    
7867  size = sizeof(real_pcre) + (length + cd->names_found * cd->name_entry_size) * sizeof(pcre_uchar);  size = sizeof(REAL_PCRE) + (length + cd->names_found * cd->name_entry_size) * sizeof(pcre_uchar);
7868  re = (real_pcre *)(PUBL(malloc))(size);  re = (REAL_PCRE *)(PUBL(malloc))(size);
7869    
7870  if (re == NULL)  if (re == NULL)
7871    {    {
# Line 7863  re->flags = cd->external_flags; Line 7886  re->flags = cd->external_flags;
7886  re->dummy1 = 0;  re->dummy1 = 0;
7887  re->first_char = 0;  re->first_char = 0;
7888  re->req_char = 0;  re->req_char = 0;
7889  re->name_table_offset = sizeof(real_pcre) / sizeof(pcre_uchar);  re->name_table_offset = sizeof(REAL_PCRE) / sizeof(pcre_uchar);
7890  re->name_entry_size = cd->name_entry_size;  re->name_entry_size = cd->name_entry_size;
7891  re->name_count = cd->names_found;  re->name_count = cd->names_found;
7892  re->ref_count = 0;  re->ref_count = 0;
# Line 8127  if ((re->flags & PCRE_REQCHSET) != 0) Line 8150  if ((re->flags & PCRE_REQCHSET) != 0)
8150    }    }
8151    
8152  #ifdef COMPILE_PCRE8  #ifdef COMPILE_PCRE8
8153  pcre_printint(re, stdout, TRUE);  pcre_printint((pcre *)re, stdout, TRUE);
8154  #else  #else
8155  pcre16_printint(re, stdout, TRUE);  pcre16_printint((pcre *)re, stdout, TRUE);
8156  #endif  #endif
8157    
8158  /* This check is done here in the debugging case so that the code that  /* This check is done here in the debugging case so that the code that
# Line 8145  if (code - codestart > length) Line 8168  if (code - codestart > length)
8168    }    }
8169  #endif   /* PCRE_DEBUG */  #endif   /* PCRE_DEBUG */
8170    
8171    #ifdef COMPILE_PCRE8
8172  return (pcre *)re;  return (pcre *)re;
8173    #else
8174    return (pcre16 *)re;
8175    #endif
8176  }  }
8177    
8178  /* End of pcre_compile.c */  /* End of pcre_compile.c */

Legend:
Removed from v.836  
changed lines
  Added in v.927

  ViewVC Help
Powered by ViewVC 1.1.5