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

Diff of /code/trunk/pcre_study.c

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

revision 914 by zherczeg, Mon Feb 13 06:04:50 2012 UTC revision 1148 by zherczeg, Sat Oct 20 20:52:52 2012 UTC
# Line 98  for (;;) Line 98  for (;;)
98    {    {
99    int d, min;    int d, min;
100    pcre_uchar *cs, *ce;    pcre_uchar *cs, *ce;
101    register int op = *cc;    register pcre_uchar op = *cc;
102    
103    switch (op)    switch (op)
104      {      {
# Line 323  for (;;) Line 323  for (;;)
323    
324      /* Check a class for variable quantification */      /* Check a class for variable quantification */
325    
 #if defined SUPPORT_UTF || !defined COMPILE_PCRE8  
     case OP_XCLASS:  
     cc += GET(cc, 1) - PRIV(OP_lengths)[OP_CLASS];  
     /* Fall through */  
 #endif  
   
326      case OP_CLASS:      case OP_CLASS:
327      case OP_NCLASS:      case OP_NCLASS:
328    #if defined SUPPORT_UTF || defined COMPILE_PCRE16 || defined COMPILE_PCRE32
329        case OP_XCLASS:
330        /* The original code caused an unsigned overflow in 64 bit systems,
331        so now we use a conditional statement. */
332        if (op == OP_XCLASS)
333          cc += GET(cc, 1);
334        else
335          cc += PRIV(OP_lengths)[OP_CLASS];
336    #else
337      cc += PRIV(OP_lengths)[OP_CLASS];      cc += PRIV(OP_lengths)[OP_CLASS];
338    #endif
339    
340      switch (*cc)      switch (*cc)
341        {        {
# Line 538  Arguments: Line 542  Arguments:
542    p             points to the character    p             points to the character
543    caseless      the caseless flag    caseless      the caseless flag
544    cd            the block with char table pointers    cd            the block with char table pointers
545    utf           TRUE for UTF-8 / UTF-16 mode    utf           TRUE for UTF-8 / UTF-16 / UTF-32 mode
546    
547  Returns:        pointer after the character  Returns:        pointer after the character
548  */  */
# Line 547  static const pcre_uchar * Line 551  static const pcre_uchar *
551  set_table_bit(pcre_uint8 *start_bits, const pcre_uchar *p, BOOL caseless,  set_table_bit(pcre_uint8 *start_bits, const pcre_uchar *p, BOOL caseless,
552    compile_data *cd, BOOL utf)    compile_data *cd, BOOL utf)
553  {  {
554  unsigned int c = *p;  pcre_uint32 c = *p;
555    
556  #ifdef COMPILE_PCRE8  #ifdef COMPILE_PCRE8
557  SET_BIT(c);  SET_BIT(c);
# Line 564  if (utf && c > 127) Line 568  if (utf && c > 127)
568      (void)PRIV(ord2utf)(c, buff);      (void)PRIV(ord2utf)(c, buff);
569      SET_BIT(buff[0]);      SET_BIT(buff[0]);
570      }      }
571  #endif  #endif  /* Not SUPPORT_UCP */
572    return p;    return p;
573    }    }
574  #endif  #else   /* Not SUPPORT_UTF */
575    (void)(utf);   /* Stops warning for unused parameter */
576    #endif  /* SUPPORT_UTF */
577    
578  /* Not UTF-8 mode, or character is less than 127. */  /* Not UTF-8 mode, or character is less than 127. */
579    
580  if (caseless && (cd->ctypes[c] & ctype_letter) != 0) SET_BIT(cd->fcc[c]);  if (caseless && (cd->ctypes[c] & ctype_letter) != 0) SET_BIT(cd->fcc[c]);
581  return p + 1;  return p + 1;
582  #endif  #endif  /* COMPILE_PCRE8 */
583    
584  #ifdef COMPILE_PCRE16  #if defined COMPILE_PCRE16 || defined COMPILE_PCRE32
585  if (c > 0xff)  if (c > 0xff)
586    {    {
587    c = 0xff;    c = 0xff;
# Line 595  if (utf && c > 127) Line 601  if (utf && c > 127)
601        c = 0xff;        c = 0xff;
602      SET_BIT(c);      SET_BIT(c);
603      }      }
604  #endif  #endif  /* SUPPORT_UCP */
605    return p;    return p;
606    }    }
607  #endif  #else   /* Not SUPPORT_UTF */
608    (void)(utf);   /* Stops warning for unused parameter */
609    #endif  /* SUPPORT_UTF */
610    
611  if (caseless && (cd->ctypes[c] & ctype_letter) != 0) SET_BIT(cd->fcc[c]);  if (caseless && (cd->ctypes[c] & ctype_letter) != 0) SET_BIT(cd->fcc[c]);
612  return p + 1;  return p + 1;
# Line 628  Returns:         nothing Line 636  Returns:         nothing
636  */  */
637    
638  static void  static void
639  set_type_bits(pcre_uint8 *start_bits, int cbit_type, int table_limit,  set_type_bits(pcre_uint8 *start_bits, int cbit_type, unsigned int table_limit,
640    compile_data *cd)    compile_data *cd)
641  {  {
642  register int c;  register pcre_uint32 c;
643  for (c = 0; c < table_limit; c++) start_bits[c] |= cd->cbits[c+cbit_type];  for (c = 0; c < table_limit; c++) start_bits[c] |= cd->cbits[c+cbit_type];
644  #if defined SUPPORT_UTF && defined COMPILE_PCRE8  #if defined SUPPORT_UTF && defined COMPILE_PCRE8
645  if (table_limit == 32) return;  if (table_limit == 32) return;
# Line 670  Returns:         nothing Line 678  Returns:         nothing
678  */  */
679    
680  static void  static void
681  set_nottype_bits(pcre_uint8 *start_bits, int cbit_type, int table_limit,  set_nottype_bits(pcre_uint8 *start_bits, int cbit_type, unsigned int table_limit,
682    compile_data *cd)    compile_data *cd)
683  {  {
684  register int c;  register pcre_uint32 c;
685  for (c = 0; c < table_limit; c++) start_bits[c] |= ~cd->cbits[c+cbit_type];  for (c = 0; c < table_limit; c++) start_bits[c] |= ~cd->cbits[c+cbit_type];
686  #if defined SUPPORT_UTF && defined COMPILE_PCRE8  #if defined SUPPORT_UTF && defined COMPILE_PCRE8
687  if (table_limit != 32) for (c = 24; c < 32; c++) start_bits[c] = 0xff;  if (table_limit != 32) for (c = 24; c < 32; c++) start_bits[c] = 0xff;
# Line 697  function fails unless the result is SSB_ Line 705  function fails unless the result is SSB_
705  Arguments:  Arguments:
706    code         points to an expression    code         points to an expression
707    start_bits   points to a 32-byte table, initialized to 0    start_bits   points to a 32-byte table, initialized to 0
708    utf          TRUE if in UTF-8 / UTF-16 mode    utf          TRUE if in UTF-8 / UTF-16 / UTF-32 mode
709    cd           the block with char table pointers    cd           the block with char table pointers
710    
711  Returns:       SSB_FAIL     => Failed to find any starting bytes  Returns:       SSB_FAIL     => Failed to find any starting bytes
# Line 710  static int Line 718  static int
718  set_start_bits(const pcre_uchar *code, pcre_uint8 *start_bits, BOOL utf,  set_start_bits(const pcre_uchar *code, pcre_uint8 *start_bits, BOOL utf,
719    compile_data *cd)    compile_data *cd)
720  {  {
721  register int c;  register pcre_uint32 c;
722  int yield = SSB_DONE;  int yield = SSB_DONE;
723  #if defined SUPPORT_UTF && defined COMPILE_PCRE8  #if defined SUPPORT_UTF && defined COMPILE_PCRE8
724  int table_limit = utf? 16:32;  int table_limit = utf? 16:32;
# Line 986  do Line 994  do
994        identical. */        identical. */
995    
996        case OP_HSPACE:        case OP_HSPACE:
997        SET_BIT(0x09);        SET_BIT(CHAR_HT);
998        SET_BIT(0x20);        SET_BIT(CHAR_SPACE);
999  #ifdef SUPPORT_UTF  #ifdef SUPPORT_UTF
1000        if (utf)        if (utf)
1001          {          {
# Line 996  do Line 1004  do
1004          SET_BIT(0xE1);  /* For U+1680, U+180E */          SET_BIT(0xE1);  /* For U+1680, U+180E */
1005          SET_BIT(0xE2);  /* For U+2000 - U+200A, U+202F, U+205F */          SET_BIT(0xE2);  /* For U+2000 - U+200A, U+202F, U+205F */
1006          SET_BIT(0xE3);  /* For U+3000 */          SET_BIT(0xE3);  /* For U+3000 */
1007  #endif  #elif defined COMPILE_PCRE16 || defined COMPILE_PCRE32
 #ifdef COMPILE_PCRE16  
1008          SET_BIT(0xA0);          SET_BIT(0xA0);
1009          SET_BIT(0xFF);  /* For characters > 255 */          SET_BIT(0xFF);  /* For characters > 255 */
1010  #endif  #endif  /* COMPILE_PCRE[8|16|32] */
1011          }          }
1012        else        else
1013  #endif /* SUPPORT_UTF */  #endif /* SUPPORT_UTF */
1014          {          {
1015    #ifndef EBCDIC
1016          SET_BIT(0xA0);          SET_BIT(0xA0);
1017  #ifdef COMPILE_PCRE16  #endif  /* Not EBCDIC */
1018    #if defined COMPILE_PCRE16 || defined COMPILE_PCRE32
1019          SET_BIT(0xFF);  /* For characters > 255 */          SET_BIT(0xFF);  /* For characters > 255 */
1020  #endif  #endif  /* COMPILE_PCRE[16|32] */
1021          }          }
1022        try_next = FALSE;        try_next = FALSE;
1023        break;        break;
1024    
1025        case OP_ANYNL:        case OP_ANYNL:
1026        case OP_VSPACE:        case OP_VSPACE:
1027        SET_BIT(0x0A);        SET_BIT(CHAR_LF);
1028        SET_BIT(0x0B);        SET_BIT(CHAR_VT);
1029        SET_BIT(0x0C);        SET_BIT(CHAR_FF);
1030        SET_BIT(0x0D);        SET_BIT(CHAR_CR);
1031  #ifdef SUPPORT_UTF  #ifdef SUPPORT_UTF
1032        if (utf)        if (utf)
1033          {          {
1034  #ifdef COMPILE_PCRE8  #ifdef COMPILE_PCRE8
1035          SET_BIT(0xC2);  /* For U+0085 */          SET_BIT(0xC2);  /* For U+0085 */
1036          SET_BIT(0xE2);  /* For U+2028, U+2029 */          SET_BIT(0xE2);  /* For U+2028, U+2029 */
1037  #endif  #elif defined COMPILE_PCRE16 || defined COMPILE_PCRE32
1038  #ifdef COMPILE_PCRE16          SET_BIT(CHAR_NEL);
         SET_BIT(0x85);  
1039          SET_BIT(0xFF);  /* For characters > 255 */          SET_BIT(0xFF);  /* For characters > 255 */
1040  #endif  #endif  /* COMPILE_PCRE[8|16|32] */
1041          }          }
1042        else        else
1043  #endif /* SUPPORT_UTF */  #endif /* SUPPORT_UTF */
1044          {          {
1045          SET_BIT(0x85);          SET_BIT(CHAR_NEL);
1046  #ifdef COMPILE_PCRE16  #if defined COMPILE_PCRE16 || defined COMPILE_PCRE32
1047          SET_BIT(0xFF);  /* For characters > 255 */          SET_BIT(0xFF);  /* For characters > 255 */
1048  #endif  #endif
1049          }          }
# Line 1058  do Line 1066  do
1066        break;        break;
1067    
1068        /* The cbit_space table has vertical tab as whitespace; we have to        /* The cbit_space table has vertical tab as whitespace; we have to
1069        ensure it is set as not whitespace. */        ensure it is set as not whitespace. Luckily, the code value is the same
1070          (0x0b) in ASCII and EBCDIC, so we can just adjust the appropriate bit. */
1071    
1072        case OP_NOT_WHITESPACE:        case OP_NOT_WHITESPACE:
1073        set_nottype_bits(start_bits, cbit_space, table_limit, cd);        set_nottype_bits(start_bits, cbit_space, table_limit, cd);
# Line 1066  do Line 1075  do
1075        try_next = FALSE;        try_next = FALSE;
1076        break;        break;
1077    
1078        /* The cbit_space table has vertical tab as whitespace; we have to        /* The cbit_space table has vertical tab as whitespace; we have to not
1079        not set it from the table. */        set it from the table. Luckily, the code value is the same (0x0b) in
1080          ASCII and EBCDIC, so we can just adjust the appropriate bit. */
1081    
1082        case OP_WHITESPACE:        case OP_WHITESPACE:
1083        c = start_bits[1];    /* Save in case it was already set */        c = start_bits[1];    /* Save in case it was already set */
# Line 1121  do Line 1131  do
1131          return SSB_FAIL;          return SSB_FAIL;
1132    
1133          case OP_HSPACE:          case OP_HSPACE:
1134          SET_BIT(0x09);          SET_BIT(CHAR_HT);
1135          SET_BIT(0x20);          SET_BIT(CHAR_SPACE);
1136  #ifdef COMPILE_PCRE8  #ifdef SUPPORT_UTF
1137          if (utf)          if (utf)
1138            {            {
1139  #ifdef COMPILE_PCRE8  #ifdef COMPILE_PCRE8
# Line 1131  do Line 1141  do
1141            SET_BIT(0xE1);  /* For U+1680, U+180E */            SET_BIT(0xE1);  /* For U+1680, U+180E */
1142            SET_BIT(0xE2);  /* For U+2000 - U+200A, U+202F, U+205F */            SET_BIT(0xE2);  /* For U+2000 - U+200A, U+202F, U+205F */
1143            SET_BIT(0xE3);  /* For U+3000 */            SET_BIT(0xE3);  /* For U+3000 */
1144  #endif  #elif defined COMPILE_PCRE16 || defined COMPILE_PCRE32
 #ifdef COMPILE_PCRE16  
1145            SET_BIT(0xA0);            SET_BIT(0xA0);
1146            SET_BIT(0xFF);  /* For characters > 255 */            SET_BIT(0xFF);  /* For characters > 255 */
1147  #endif  #endif  /* COMPILE_PCRE[8|16|32] */
1148            }            }
1149          else          else
1150  #endif /* SUPPORT_UTF */  #endif /* SUPPORT_UTF */
1151    #ifndef EBCDIC
1152            SET_BIT(0xA0);            SET_BIT(0xA0);
1153    #endif  /* Not EBCDIC */
1154          break;          break;
1155    
1156          case OP_ANYNL:          case OP_ANYNL:
1157          case OP_VSPACE:          case OP_VSPACE:
1158          SET_BIT(0x0A);          SET_BIT(CHAR_LF);
1159          SET_BIT(0x0B);          SET_BIT(CHAR_VT);
1160          SET_BIT(0x0C);          SET_BIT(CHAR_FF);
1161          SET_BIT(0x0D);          SET_BIT(CHAR_CR);
1162  #ifdef COMPILE_PCRE8  #ifdef SUPPORT_UTF
1163          if (utf)          if (utf)
1164            {            {
1165  #ifdef COMPILE_PCRE8  #ifdef COMPILE_PCRE8
1166            SET_BIT(0xC2);  /* For U+0085 */            SET_BIT(0xC2);  /* For U+0085 */
1167            SET_BIT(0xE2);  /* For U+2028, U+2029 */            SET_BIT(0xE2);  /* For U+2028, U+2029 */
1168  #endif  #elif defined COMPILE_PCRE16 || defined COMPILE_PCRE32
1169  #ifdef COMPILE_PCRE16            SET_BIT(CHAR_NEL);
           SET_BIT(0x85);  
1170            SET_BIT(0xFF);  /* For characters > 255 */            SET_BIT(0xFF);  /* For characters > 255 */
1171  #endif  #endif  /* COMPILE_PCRE16 */
1172            }            }
1173          else          else
1174  #endif /* SUPPORT_UTF */  #endif /* SUPPORT_UTF */
1175            SET_BIT(0x85);            SET_BIT(CHAR_NEL);
1176          break;          break;
1177    
1178          case OP_NOT_DIGIT:          case OP_NOT_DIGIT:
# Line 1174  do Line 1184  do
1184          break;          break;
1185    
1186          /* The cbit_space table has vertical tab as whitespace; we have to          /* The cbit_space table has vertical tab as whitespace; we have to
1187          ensure it gets set as not whitespace. */          ensure it gets set as not whitespace. Luckily, the code value is the
1188            same (0x0b) in ASCII and EBCDIC, so we can just adjust the appropriate
1189            bit. */
1190    
1191          case OP_NOT_WHITESPACE:          case OP_NOT_WHITESPACE:
1192          set_nottype_bits(start_bits, cbit_space, table_limit, cd);          set_nottype_bits(start_bits, cbit_space, table_limit, cd);
# Line 1182  do Line 1194  do
1194          break;          break;
1195    
1196          /* The cbit_space table has vertical tab as whitespace; we have to          /* The cbit_space table has vertical tab as whitespace; we have to
1197          avoid setting it. */          avoid setting it. Luckily, the code value is the same (0x0b) in ASCII
1198            and EBCDIC, so we can just adjust the appropriate bit. */
1199    
1200          case OP_WHITESPACE:          case OP_WHITESPACE:
1201          c = start_bits[1];    /* Save in case it was already set */          c = start_bits[1];    /* Save in case it was already set */
# Line 1216  do Line 1229  do
1229          memset(start_bits+25, 0xff, 7);      /* Bits for 0xc9 - 0xff */          memset(start_bits+25, 0xff, 7);      /* Bits for 0xc9 - 0xff */
1230          }          }
1231  #endif  #endif
1232  #ifdef COMPILE_PCRE16  #if defined COMPILE_PCRE16 || defined COMPILE_PCRE32
1233        SET_BIT(0xFF);                         /* For characters > 255 */        SET_BIT(0xFF);                         /* For characters > 255 */
1234  #endif  #endif
1235        /* Fall through */        /* Fall through */
# Line 1312  Returns:    pointer to a pcre[16]_extra Line 1325  Returns:    pointer to a pcre[16]_extra
1325              NULL on error or if no optimization possible              NULL on error or if no optimization possible
1326  */  */
1327    
1328  #ifdef COMPILE_PCRE8  #if defined COMPILE_PCRE8
1329  PCRE_EXP_DEFN pcre_extra * PCRE_CALL_CONVENTION  PCRE_EXP_DEFN pcre_extra * PCRE_CALL_CONVENTION
1330  pcre_study(const pcre *external_re, int options, const char **errorptr)  pcre_study(const pcre *external_re, int options, const char **errorptr)
1331  #else  #elif defined COMPILE_PCRE16
1332  PCRE_EXP_DEFN pcre16_extra * PCRE_CALL_CONVENTION  PCRE_EXP_DEFN pcre16_extra * PCRE_CALL_CONVENTION
1333  pcre16_study(const pcre16 *external_re, int options, const char **errorptr)  pcre16_study(const pcre16 *external_re, int options, const char **errorptr)
1334    #elif defined COMPILE_PCRE32
1335    PCRE_EXP_DEFN pcre32_extra * PCRE_CALL_CONVENTION
1336    pcre32_study(const pcre32 *external_re, int options, const char **errorptr)
1337  #endif  #endif
1338  {  {
1339  int min;  int min;
# Line 1340  if (re == NULL || re->magic_number != MA Line 1356  if (re == NULL || re->magic_number != MA
1356    
1357  if ((re->flags & PCRE_MODE) == 0)  if ((re->flags & PCRE_MODE) == 0)
1358    {    {
1359  #ifdef COMPILE_PCRE8  #if defined COMPILE_PCRE8
1360    *errorptr = "argument is compiled in 16 bit mode";    *errorptr = "argument not compiled in 8 bit mode";
1361  #else  #elif defined COMPILE_PCRE16
1362    *errorptr = "argument is compiled in 8 bit mode";    *errorptr = "argument not compiled in 16 bit mode";
1363    #elif defined COMPILE_PCRE32
1364      *errorptr = "argument not compiled in 32 bit mode";
1365  #endif  #endif
1366    return NULL;    return NULL;
1367    }    }
# Line 1370  if ((re->options & PCRE_ANCHORED) == 0 & Line 1388  if ((re->options & PCRE_ANCHORED) == 0 &
1388    
1389    tables = re->tables;    tables = re->tables;
1390    
1391  #ifdef COMPILE_PCRE8  #if defined COMPILE_PCRE8
1392    if (tables == NULL)    if (tables == NULL)
1393      (void)pcre_fullinfo(external_re, NULL, PCRE_INFO_DEFAULT_TABLES,      (void)pcre_fullinfo(external_re, NULL, PCRE_INFO_DEFAULT_TABLES,
1394      (void *)(&tables));      (void *)(&tables));
1395  #else  #elif defined COMPILE_PCRE16
1396    if (tables == NULL)    if (tables == NULL)
1397      (void)pcre16_fullinfo(external_re, NULL, PCRE_INFO_DEFAULT_TABLES,      (void)pcre16_fullinfo(external_re, NULL, PCRE_INFO_DEFAULT_TABLES,
1398      (void *)(&tables));      (void *)(&tables));
1399    #elif defined COMPILE_PCRE32
1400      if (tables == NULL)
1401        (void)pcre32_fullinfo(external_re, NULL, PCRE_INFO_DEFAULT_TABLES,
1402        (void *)(&tables));
1403  #endif  #endif
1404    
1405    compile_block.lcc = tables + lcc_offset;    compile_block.lcc = tables + lcc_offset;
# Line 1408  switch(min = find_minlength(code, code, Line 1430  switch(min = find_minlength(code, code,
1430    }    }
1431    
1432  /* If a set of starting bytes has been identified, or if the minimum length is  /* If a set of starting bytes has been identified, or if the minimum length is
1433  greater than zero, or if JIT optimization has been requested, get a  greater than zero, or if JIT optimization has been requested, or if
1434  pcre[16]_extra block and a pcre_study_data block. The study data is put in the  PCRE_STUDY_EXTRA_NEEDED is set, get a pcre[16]_extra block and a
1435  latter, which is pointed to by the former, which may also get additional data  pcre_study_data block. The study data is put in the latter, which is pointed to
1436  set later by the calling program. At the moment, the size of pcre_study_data  by the former, which may also get additional data set later by the calling
1437  is fixed. We nevertheless save it in a field for returning via the  program. At the moment, the size of pcre_study_data is fixed. We nevertheless
1438  pcre_fullinfo() function so that if it becomes variable in the future,  save it in a field for returning via the pcre_fullinfo() function so that if it
1439  we don't have to change that code. */  becomes variable in the future, we don't have to change that code. */
1440    
1441  if (bits_set || min > 0  if (bits_set || min > 0 || (options & (
1442  #ifdef SUPPORT_JIT  #ifdef SUPPORT_JIT
1443      || (options & (PCRE_STUDY_JIT_COMPILE | PCRE_STUDY_JIT_PARTIAL_SOFT_COMPILE      PCRE_STUDY_JIT_COMPILE | PCRE_STUDY_JIT_PARTIAL_SOFT_COMPILE |
1444                   | PCRE_STUDY_JIT_PARTIAL_HARD_COMPILE)) != 0      PCRE_STUDY_JIT_PARTIAL_HARD_COMPILE |
1445  #endif  #endif
1446    )      PCRE_STUDY_EXTRA_NEEDED)) != 0)
1447    {    {
1448    extra = (PUBL(extra) *)(PUBL(malloc))    extra = (PUBL(extra) *)(PUBL(malloc))
1449      (sizeof(PUBL(extra)) + sizeof(pcre_study_data));      (sizeof(PUBL(extra)) + sizeof(pcre_study_data));
# Line 1475  if (bits_set || min > 0 Line 1497  if (bits_set || min > 0
1497    
1498    /* If JIT support was compiled and requested, attempt the JIT compilation.    /* If JIT support was compiled and requested, attempt the JIT compilation.
1499    If no starting bytes were found, and the minimum length is zero, and JIT    If no starting bytes were found, and the minimum length is zero, and JIT
1500    compilation fails, abandon the extra block and return NULL. */    compilation fails, abandon the extra block and return NULL, unless
1501      PCRE_STUDY_EXTRA_NEEDED is set. */
1502    
1503  #ifdef SUPPORT_JIT  #ifdef SUPPORT_JIT
1504    extra->executable_jit = NULL;    extra->executable_jit = NULL;
# Line 1486  if (bits_set || min > 0 Line 1509  if (bits_set || min > 0
1509    if ((options & PCRE_STUDY_JIT_PARTIAL_HARD_COMPILE) != 0)    if ((options & PCRE_STUDY_JIT_PARTIAL_HARD_COMPILE) != 0)
1510      PRIV(jit_compile)(re, extra, JIT_PARTIAL_HARD_COMPILE);      PRIV(jit_compile)(re, extra, JIT_PARTIAL_HARD_COMPILE);
1511    
1512    if (study->flags == 0 && (extra->flags & PCRE_EXTRA_EXECUTABLE_JIT) == 0)    if (study->flags == 0 && (extra->flags & PCRE_EXTRA_EXECUTABLE_JIT) == 0 &&
1513          (options & PCRE_STUDY_EXTRA_NEEDED) == 0)
1514      {      {
1515  #ifdef COMPILE_PCRE8  #if defined COMPILE_PCRE8
1516      pcre_free_study(extra);      pcre_free_study(extra);
1517  #endif  #elif defined COMPILE_PCRE16
 #ifdef COMPILE_PCRE16  
1518      pcre16_free_study(extra);      pcre16_free_study(extra);
1519    #elif defined COMPILE_PCRE32
1520        pcre32_free_study(extra);
1521  #endif  #endif
1522      extra = NULL;      extra = NULL;
1523      }      }
# Line 1513  Argument:   a pointer to the pcre[16]_ex Line 1538  Argument:   a pointer to the pcre[16]_ex
1538  Returns:    nothing  Returns:    nothing
1539  */  */
1540    
1541  #ifdef COMPILE_PCRE8  #if defined COMPILE_PCRE8
1542  PCRE_EXP_DEFN void  PCRE_EXP_DEFN void
1543  pcre_free_study(pcre_extra *extra)  pcre_free_study(pcre_extra *extra)
1544  #else  #elif defined COMPILE_PCRE16
1545  PCRE_EXP_DEFN void  PCRE_EXP_DEFN void
1546  pcre16_free_study(pcre16_extra *extra)  pcre16_free_study(pcre16_extra *extra)
1547    #elif defined COMPILE_PCRE32
1548    PCRE_EXP_DEFN void
1549    pcre32_free_study(pcre32_extra *extra)
1550  #endif  #endif
1551  {  {
1552  if (extra == NULL)  if (extra == NULL)

Legend:
Removed from v.914  
changed lines
  Added in v.1148

  ViewVC Help
Powered by ViewVC 1.1.5