/[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 1155 by ph10, Sun Oct 21 17:13:28 2012 UTC revision 1221 by ph10, Sun Nov 11 20:27:03 2012 UTC
# Line 199  if (caseless) Line 199  if (caseless)
199        GETCHARINC(c, eptr);        GETCHARINC(c, eptr);
200        GETCHARINC(d, p);        GETCHARINC(d, p);
201        ur = GET_UCD(d);        ur = GET_UCD(d);
202        if (c != d && c != d + ur->other_case)        if (c != d && c != d + ur->other_case)
203          {          {
204          const pcre_uint32 *pp = PRIV(ucd_caseless_sets) + ur->caseset;          const pcre_uint32 *pp = PRIV(ucd_caseless_sets) + ur->caseset;
205          for (;;)          for (;;)
206            {            {
207            if (c < *pp) return -1;            if (c < *pp) return -1;
# Line 294  enum { RM1=1, RM2,  RM3,  RM4,  RM5,  RM Line 294  enum { RM1=1, RM2,  RM3,  RM4,  RM5,  RM
294         RM31,  RM32, RM33, RM34, RM35, RM36, RM37, RM38, RM39, RM40,         RM31,  RM32, RM33, RM34, RM35, RM36, RM37, RM38, RM39, RM40,
295         RM41,  RM42, RM43, RM44, RM45, RM46, RM47, RM48, RM49, RM50,         RM41,  RM42, RM43, RM44, RM45, RM46, RM47, RM48, RM49, RM50,
296         RM51,  RM52, RM53, RM54, RM55, RM56, RM57, RM58, RM59, RM60,         RM51,  RM52, RM53, RM54, RM55, RM56, RM57, RM58, RM59, RM60,
297         RM61,  RM62, RM63, RM64, RM65, RM66 };         RM61,  RM62, RM63, RM64, RM65, RM66, RM67 };
298    
299  /* 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
300  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 2532  for (;;) Line 2532  for (;;)
2532        }        }
2533      GETCHARINCTEST(c, eptr);      GETCHARINCTEST(c, eptr);
2534        {        {
2535        const pcre_uint32 *cp;        const pcre_uint32 *cp;
2536        const ucd_record *prop = GET_UCD(c);        const ucd_record *prop = GET_UCD(c);
2537    
2538        switch(ecode[1])        switch(ecode[1])
# Line 2594  for (;;) Line 2594  for (;;)
2594          break;          break;
2595    
2596          case PT_CLIST:          case PT_CLIST:
2597          cp = PRIV(ucd_caseless_sets) + prop->caseset;          cp = PRIV(ucd_caseless_sets) + ecode[2];
2598          for (;;)          for (;;)
2599            {            {
2600            if (c < *cp)            if (c < *cp)
# Line 4203  for (;;) Line 4203  for (;;)
4203                RRETURN(MATCH_NOMATCH);                RRETURN(MATCH_NOMATCH);
4204              }              }
4205            break;            break;
4206    
4207            case PT_CLIST:            case PT_CLIST:
4208            for (i = 1; i <= min; i++)            for (i = 1; i <= min; i++)
4209              {              {
4210              const pcre_uint32 *cp;              const pcre_uint32 *cp;
4211              if (eptr >= md->end_subject)              if (eptr >= md->end_subject)
4212                {                {
# Line 4214  for (;;) Line 4214  for (;;)
4214                RRETURN(MATCH_NOMATCH);                RRETURN(MATCH_NOMATCH);
4215                }                }
4216              GETCHARINCTEST(c, eptr);              GETCHARINCTEST(c, eptr);
4217              cp = PRIV(ucd_caseless_sets) + UCD_CASESET(c);              cp = PRIV(ucd_caseless_sets) + prop_value;
4218              for (;;)              for (;;)
4219                {                {
4220                if (c < *cp)                if (c < *cp)
4221                  { if (prop_fail_result) break; else { RRETURN(MATCH_NOMATCH); } }                  { if (prop_fail_result) break; else { RRETURN(MATCH_NOMATCH); } }
4222                if (c == *cp++)                if (c == *cp++)
4223                  { if (prop_fail_result) { RRETURN(MATCH_NOMATCH); } else break; }                  { if (prop_fail_result) { RRETURN(MATCH_NOMATCH); } else break; }
4224                }                }
4225              }              }
4226            break;            break;
4227    
4228            /* This should not occur */            /* This should not occur */
4229    
4230            default:            default:
# Line 4954  for (;;) Line 4954  for (;;)
4954    
4955            case PT_CLIST:            case PT_CLIST:
4956            for (fi = min;; fi++)            for (fi = min;; fi++)
4957              {              {
4958              const pcre_uint32 *cp;              const pcre_uint32 *cp;
4959              RMATCH(eptr, ecode, offset_top, md, eptrb, RM62);              RMATCH(eptr, ecode, offset_top, md, eptrb, RM67);
4960              if (rrc != MATCH_NOMATCH) RRETURN(rrc);              if (rrc != MATCH_NOMATCH) RRETURN(rrc);
4961              if (fi >= max) RRETURN(MATCH_NOMATCH);              if (fi >= max) RRETURN(MATCH_NOMATCH);
4962              if (eptr >= md->end_subject)              if (eptr >= md->end_subject)
# Line 4965  for (;;) Line 4965  for (;;)
4965                RRETURN(MATCH_NOMATCH);                RRETURN(MATCH_NOMATCH);
4966                }                }
4967              GETCHARINCTEST(c, eptr);              GETCHARINCTEST(c, eptr);
4968              cp = PRIV(ucd_caseless_sets) + UCD_CASESET(c);              cp = PRIV(ucd_caseless_sets) + prop_value;
4969              for (;;)              for (;;)
4970                {                {
4971                if (c < *cp)                if (c < *cp)
# Line 5445  for (;;) Line 5445  for (;;)
5445              eptr+= len;              eptr+= len;
5446              }              }
5447            break;            break;
5448    
5449            case PT_CLIST:            case PT_CLIST:
5450            for (i = min; i < max; i++)            for (i = min; i < max; i++)
5451              {              {
# Line 5457  for (;;) Line 5457  for (;;)
5457                break;                break;
5458                }                }
5459              GETCHARLENTEST(c, eptr, len);              GETCHARLENTEST(c, eptr, len);
5460              cp = PRIV(ucd_caseless_sets) + UCD_CASESET(c);              cp = PRIV(ucd_caseless_sets) + prop_value;
5461              for (;;)              for (;;)
5462                {                {
5463                if (c < *cp)                if (c < *cp)
5464                  { if (prop_fail_result) break; else goto GOT_MAX; }                  { if (prop_fail_result) break; else goto GOT_MAX; }
5465                if (c == *cp++)                if (c == *cp++)
5466                  { if (prop_fail_result) goto GOT_MAX; else break; }                  { if (prop_fail_result) goto GOT_MAX; else break; }
5467                }                }
5468              eptr += len;              eptr += len;
5469              }              }
5470            GOT_MAX:            GOT_MAX:
5471            break;            break;
5472    
5473            default:            default:
# Line 6111  switch (frame->Xwhere) Line 6111  switch (frame->Xwhere)
6111    LBL(32) LBL(34) LBL(42) LBL(46)    LBL(32) LBL(34) LBL(42) LBL(46)
6112  #ifdef SUPPORT_UCP  #ifdef SUPPORT_UCP
6113    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)
6114    LBL(59) LBL(60) LBL(61) LBL(62)    LBL(59) LBL(60) LBL(61) LBL(62) LBL(67)
6115  #endif  /* SUPPORT_UCP */  #endif  /* SUPPORT_UCP */
6116  #endif  /* SUPPORT_UTF */  #endif  /* SUPPORT_UTF */
6117    default:    default:
6118    DPRINTF(("jump error in pcre match: label %d non-existent\n", frame->Xwhere));    DPRINTF(("jump error in pcre match: label %d non-existent\n", frame->Xwhere));
   
 printf("+++jump error in pcre match: label %d non-existent\n", frame->Xwhere);  
   
6119    return PCRE_ERROR_INTERNAL;    return PCRE_ERROR_INTERNAL;
6120    }    }
6121  #undef LBL  #undef LBL
# Line 6298  if ((options & ~PUBLIC_EXEC_OPTIONS) != Line 6295  if ((options & ~PUBLIC_EXEC_OPTIONS) !=
6295  if (re == NULL || subject == NULL || (offsets == NULL && offsetcount > 0))  if (re == NULL || subject == NULL || (offsets == NULL && offsetcount > 0))
6296    return PCRE_ERROR_NULL;    return PCRE_ERROR_NULL;
6297  if (offsetcount < 0) return PCRE_ERROR_BADCOUNT;  if (offsetcount < 0) return PCRE_ERROR_BADCOUNT;
6298    if (length < 0) return PCRE_ERROR_BADLENGTH;
6299  if (start_offset < 0 || start_offset > length) return PCRE_ERROR_BADOFFSET;  if (start_offset < 0 || start_offset > length) return PCRE_ERROR_BADOFFSET;
6300    
6301  /* Check that the first field in the block is the magic number. If it is not,  /* Check that the first field in the block is the magic number. If it is not,
# Line 6364  if (extra_data != NULL Line 6362  if (extra_data != NULL
6362      && (extra_data->flags & (PCRE_EXTRA_EXECUTABLE_JIT |      && (extra_data->flags & (PCRE_EXTRA_EXECUTABLE_JIT |
6363                               PCRE_EXTRA_TABLES)) == PCRE_EXTRA_EXECUTABLE_JIT                               PCRE_EXTRA_TABLES)) == PCRE_EXTRA_EXECUTABLE_JIT
6364      && extra_data->executable_jit != NULL      && extra_data->executable_jit != NULL
6365      && (options & ~(PCRE_NO_UTF8_CHECK | PCRE_NOTBOL | PCRE_NOTEOL |      && (options & ~PUBLIC_JIT_EXEC_OPTIONS) == 0)
                     PCRE_NOTEMPTY | PCRE_NOTEMPTY_ATSTART |  
                     PCRE_PARTIAL_SOFT | PCRE_PARTIAL_HARD)) == 0)  
6366    {    {
6367    rc = PRIV(jit_exec)(re, extra_data, (const pcre_uchar *)subject, length,    rc = PRIV(jit_exec)(extra_data, (const pcre_uchar *)subject, length,
6368         start_offset, options, offsets, offsetcount);         start_offset, options, offsets, offsetcount);
6369    
6370    /* PCRE_ERROR_NULL means that the selected normal or partial matching    /* PCRE_ERROR_NULL means that the selected normal or partial matching
6371    mode is not compiled. In this case we simply fallback to interpreter. */    mode is not compiled. In this case we simply fallback to interpreter. */
6372    
6373    if (rc != PCRE_ERROR_NULL) return rc;    if (rc != PCRE_ERROR_JIT_BADOPTION) return rc;
6374    }    }
6375  #endif  #endif
6376    

Legend:
Removed from v.1155  
changed lines
  Added in v.1221

  ViewVC Help
Powered by ViewVC 1.1.5