/[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 1397 by ph10, Mon Nov 11 18:33:23 2013 UTC revision 1417 by ph10, Tue Dec 24 18:03:06 2013 UTC
# Line 167  match_ref(int offset, register PCRE_PUCH Line 167  match_ref(int offset, register PCRE_PUCH
167  {  {
168  PCRE_PUCHAR eptr_start = eptr;  PCRE_PUCHAR eptr_start = eptr;
169  register PCRE_PUCHAR p = md->start_subject + md->offset_vector[offset];  register PCRE_PUCHAR p = md->start_subject + md->offset_vector[offset];
170  #ifdef SUPPORT_UTF  #if defined SUPPORT_UTF && defined SUPPORT_UCP
171  BOOL utf = md->utf;  BOOL utf = md->utf;
172  #endif  #endif
173    
# Line 195  ASCII characters. */ Line 195  ASCII characters. */
195    
196  if (caseless)  if (caseless)
197    {    {
198  #ifdef SUPPORT_UTF  #if defined SUPPORT_UTF && defined SUPPORT_UCP
 #ifdef SUPPORT_UCP  
199    if (utf)    if (utf)
200      {      {
201      /* Match characters up to the end of the reference. NOTE: the number of      /* Match characters up to the end of the reference. NOTE: the number of
# Line 230  if (caseless) Line 229  if (caseless)
229      }      }
230    else    else
231  #endif  #endif
 #endif  
232    
233    /* The same code works when not in UTF-8 mode and in UTF-8 mode when there    /* The same code works when not in UTF-8 mode and in UTF-8 mode when there
234    is no UCP support. */    is no UCP support. */
# Line 312  enum { RM1=1, RM2,  RM3,  RM4,  RM5,  RM Line 310  enum { RM1=1, RM2,  RM3,  RM4,  RM5,  RM
310         RM31,  RM32, RM33, RM34, RM35, RM36, RM37, RM38, RM39, RM40,         RM31,  RM32, RM33, RM34, RM35, RM36, RM37, RM38, RM39, RM40,
311         RM41,  RM42, RM43, RM44, RM45, RM46, RM47, RM48, RM49, RM50,         RM41,  RM42, RM43, RM44, RM45, RM46, RM47, RM48, RM49, RM50,
312         RM51,  RM52, RM53, RM54, RM55, RM56, RM57, RM58, RM59, RM60,         RM51,  RM52, RM53, RM54, RM55, RM56, RM57, RM58, RM59, RM60,
313         RM61,  RM62, RM63, RM64, RM65, RM66, RM67, RM68 };         RM61,  RM62, RM63, RM64, RM65, RM66, RM67 };
314    
315  /* These versions of the macros use the stack, as normal. There are debugging  /* These versions of the macros use the stack, as normal. There are debugging
316  versions and production versions. Note that the "rw" argument of RMATCH isn't  versions and production versions. Note that the "rw" argument of RMATCH isn't
# Line 2693  for (;;) Line 2691  for (;;)
2691        pcre_uchar *slot = md->name_table + GET2(ecode, 1) * md->name_entry_size;        pcre_uchar *slot = md->name_table + GET2(ecode, 1) * md->name_entry_size;
2692        ecode += 1 + 2*IMM2_SIZE;        ecode += 1 + 2*IMM2_SIZE;
2693    
2694          /* Setting the default length first and initializing 'offset' avoids
2695          compiler warnings in the REF_REPEAT code. */
2696    
2697          length = (md->jscript_compat)? 0 : -1;
2698          offset = 0;
2699    
2700        while (count-- > 0)        while (count-- > 0)
2701          {          {
2702          offset = GET2(slot, 0) << 1;          offset = GET2(slot, 0) << 1;
2703          if (offset < offset_top && md->offset_vector[offset] >= 0) break;          if (offset < offset_top && md->offset_vector[offset] >= 0)
2704              {
2705              length = md->offset_vector[offset+1] - md->offset_vector[offset];
2706              break;
2707              }
2708          slot += md->name_entry_size;          slot += md->name_entry_size;
2709          }          }
       if (count < 0)  
         length = (md->jscript_compat)? 0 : -1;  
       else  
         length = md->offset_vector[offset+1] - md->offset_vector[offset];  
2710        }        }
2711      goto REF_REPEAT;      goto REF_REPEAT;
2712    
# Line 3075  for (;;) Line 3079  for (;;)
3079      /* Control never gets here */      /* Control never gets here */
3080    
3081    
3082      /* Match an extended character class. This opcode is encountered only      /* Match an extended character class. In the 8-bit library, this opcode is
3083      when UTF-8 mode mode is supported. Nevertheless, we may not be in UTF-8      encountered only when UTF-8 mode mode is supported. In the 16-bit and
3084      mode, because Unicode properties are supported in non-UTF-8 mode. */      32-bit libraries, codepoints greater than 255 may be encountered even when
3085        UTF is not supported. */
3086    
3087  #if defined SUPPORT_UTF || !defined COMPILE_PCRE8  #if defined SUPPORT_UTF || !defined COMPILE_PCRE8
3088      case OP_XCLASS:      case OP_XCLASS:
# Line 5054  for (;;) Line 5059  for (;;)
5059            case PT_UCNC:            case PT_UCNC:
5060            for (fi = min;; fi++)            for (fi = min;; fi++)
5061              {              {
5062              RMATCH(eptr, ecode, offset_top, md, eptrb, RM68);              RMATCH(eptr, ecode, offset_top, md, eptrb, RM60);
5063              if (rrc != MATCH_NOMATCH) RRETURN(rrc);              if (rrc != MATCH_NOMATCH) RRETURN(rrc);
5064              if (fi >= max) RRETURN(MATCH_NOMATCH);              if (fi >= max) RRETURN(MATCH_NOMATCH);
5065              if (eptr >= md->end_subject)              if (eptr >= md->end_subject)
# Line 6219  switch (frame->Xwhere) Line 6224  switch (frame->Xwhere)
6224    LBL(53) LBL(54) LBL(55) LBL(56) LBL(57) LBL(58) LBL(63) LBL(64)    LBL(53) LBL(54) LBL(55) LBL(56) LBL(57) LBL(58) LBL(63) LBL(64)
6225    LBL(65) LBL(66)    LBL(65) LBL(66)
6226  #if defined SUPPORT_UTF || !defined COMPILE_PCRE8  #if defined SUPPORT_UTF || !defined COMPILE_PCRE8
6227    LBL(21)    LBL(20) LBL(21)
6228  #endif  #endif
6229  #ifdef SUPPORT_UTF  #ifdef SUPPORT_UTF
6230    LBL(16) LBL(18) LBL(20)    LBL(16) LBL(18)
6231    LBL(22) LBL(23) LBL(28) LBL(30)    LBL(22) LBL(23) LBL(28) LBL(30)
6232    LBL(32) LBL(34) LBL(42) LBL(46)    LBL(32) LBL(34) LBL(42) LBL(46)
6233  #ifdef SUPPORT_UCP  #ifdef SUPPORT_UCP
6234    LBL(36) LBL(37) LBL(38) LBL(39) LBL(40) LBL(41) LBL(44) LBL(45)    LBL(36) LBL(37) LBL(38) LBL(39) LBL(40) LBL(41) LBL(44) LBL(45)
6235    LBL(59) LBL(60) LBL(61) LBL(62) LBL(67) LBL(68)    LBL(59) LBL(60) LBL(61) LBL(62) LBL(67)
6236  #endif  /* SUPPORT_UCP */  #endif  /* SUPPORT_UCP */
6237  #endif  /* SUPPORT_UTF */  #endif  /* SUPPORT_UTF */
6238    default:    default:
# Line 6834  for(;;) Line 6839  for(;;)
6839  #ifndef COMPILE_PCRE8  #ifndef COMPILE_PCRE8
6840          if (c > 255) c = 255;          if (c > 255) c = 255;
6841  #endif  #endif
6842          if ((start_bits[c/8] & (1 << (c&7))) == 0)          if ((start_bits[c/8] & (1 << (c&7))) != 0) break;
6843            {          start_match++;
           start_match++;  
 #if defined SUPPORT_UTF && defined COMPILE_PCRE8  
           /* In non 8-bit mode, the iteration will stop for  
           characters > 255 at the beginning or not stop at all. */  
           if (utf)  
             ACROSSCHAR(start_match < end_subject, *start_match,  
               start_match++);  
 #endif  
           }  
         else break;  
6844          }          }
6845        }        }
6846      }   /* Starting optimizations */      }   /* Starting optimizations */

Legend:
Removed from v.1397  
changed lines
  Added in v.1417

  ViewVC Help
Powered by ViewVC 1.1.5