/[pcre]/code/branches/pcre16/pcre_study.c
ViewVC logotype

Diff of /code/branches/pcre16/pcre_study.c

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

revision 769 by zherczeg, Sun Nov 27 17:40:33 2011 UTC revision 770 by zherczeg, Mon Nov 28 20:39:30 2011 UTC
# Line 322  for (;;) Line 322  for (;;)
322    
323      /* Check a class for variable quantification */      /* Check a class for variable quantification */
324    
325  #ifdef SUPPORT_UTF8  #if defined SUPPORT_UTF8 || !defined COMPILE_PCRE8
326      case OP_XCLASS:      case OP_XCLASS:
327      cc += GET(cc, 1) - 33;      cc += GET(cc, 1) - PRIV(OP_lengths)[OP_CLASS];
328      /* Fall through */      /* Fall through */
329  #endif  #endif
330    
331      case OP_CLASS:      case OP_CLASS:
332      case OP_NCLASS:      case OP_NCLASS:
333      cc += 33;      cc += PRIV(OP_lengths)[OP_CLASS];
334    
335      switch (*cc)      switch (*cc)
336        {        {
# Line 789  do Line 789  do
789        case OP_SOM:        case OP_SOM:
790        case OP_THEN:        case OP_THEN:
791        case OP_THEN_ARG:        case OP_THEN_ARG:
792    #if defined SUPPORT_UTF8 || !defined COMPILE_PCRE8
793        case OP_XCLASS:        case OP_XCLASS:
794    #endif
795        return SSB_FAIL;        return SSB_FAIL;
796    
797        /* We can ignore word boundary tests. */        /* We can ignore word boundary tests. */
# Line 1134  do Line 1136  do
1136    
1137        case OP_CLASS:        case OP_CLASS:
1138          {          {
1139            pcre_uint8 *map;
1140          tcode++;          tcode++;
1141            map = (pcre_uint8 *)tcode;
1142    
1143          /* In UTF-8 mode, the bits in a bit map correspond to character          /* In UTF-8 mode, the bits in a bit map correspond to character
1144          values, not to byte values. However, the bit map we are constructing is          values, not to byte values. However, the bit map we are constructing is
# Line 1145  do Line 1149  do
1149  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
1150          if (utf8)          if (utf8)
1151            {            {
1152            for (c = 0; c < 16; c++) start_bits[c] |= tcode[c];            for (c = 0; c < 16; c++) start_bits[c] |= map[c];
1153            for (c = 128; c < 256; c++)            for (c = 128; c < 256; c++)
1154              {              {
1155              if ((tcode[c/8] && (1 << (c&7))) != 0)              if ((map[c/8] && (1 << (c&7))) != 0)
1156                {                {
1157                int d = (c >> 6) | 0xc0;            /* Set bit for this starter */                int d = (c >> 6) | 0xc0;            /* Set bit for this starter */
1158                start_bits[d/8] |= (1 << (d&7));    /* and then skip on to the */                start_bits[d/8] |= (1 << (d&7));    /* and then skip on to the */
# Line 1162  do Line 1166  do
1166          else          else
1167  #endif  #endif
1168            {            {
1169            for (c = 0; c < 32; c++) start_bits[c] |= tcode[c];            for (c = 0; c < 32; c++) start_bits[c] |= map[c];
1170            }            }
1171    
1172          /* Advance past the bit map, and act on what follows. For a zero          /* Advance past the bit map, and act on what follows. For a zero
1173          minimum repeat, continue; otherwise stop processing. */          minimum repeat, continue; otherwise stop processing. */
1174    
1175          tcode += 32;          tcode += 32 / sizeof(pcre_uchar);
1176          switch (*tcode)          switch (*tcode)
1177            {            {
1178            case OP_CRSTAR:            case OP_CRSTAR:

Legend:
Removed from v.769  
changed lines
  Added in v.770

  ViewVC Help
Powered by ViewVC 1.1.5