/[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 1238 by ph10, Sat Jan 5 16:27:59 2013 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 416  typedef struct heapframe { Line 416  typedef struct heapframe {
416    int Xlength;    int Xlength;
417    int Xmax;    int Xmax;
418    int Xmin;    int Xmin;
419    int Xnumber;    unsigned int Xnumber;
420    int Xoffset;    int Xoffset;
421    int Xop;    unsigned int Xop;
422    int Xsave_capture_last;    int Xsave_capture_last;
423    int Xsave_offset1, Xsave_offset2, Xsave_offset3;    int Xsave_offset1, Xsave_offset2, Xsave_offset3;
424    int Xstacksave[REC_STACK_SAVE_MAX];    int Xstacksave[REC_STACK_SAVE_MAX];
# Line 634  int max; Line 634  int max;
634  int min;  int min;
635  unsigned int number;  unsigned int number;
636  int offset;  int offset;
637  pcre_uchar op;  unsigned int op;
638  int save_capture_last;  int save_capture_last;
639  int save_offset1, save_offset2, save_offset3;  int save_offset1, save_offset2, save_offset3;
640  int stacksave[REC_STACK_SAVE_MAX];  int stacksave[REC_STACK_SAVE_MAX];
# 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 3439  for (;;) Line 3439  for (;;)
3439    
3440        for (i = 1; i <= min; i++)        for (i = 1; i <= min; i++)
3441          {          {
3442          pcre_uchar cc;          pcre_uint32 cc;                 /* Faster than pcre_uchar */
   
3443          if (eptr >= md->end_subject)          if (eptr >= md->end_subject)
3444            {            {
3445            SCHECK_PARTIAL();            SCHECK_PARTIAL();
# Line 3455  for (;;) Line 3454  for (;;)
3454          {          {
3455          for (fi = min;; fi++)          for (fi = min;; fi++)
3456            {            {
3457            pcre_uchar cc;            pcre_uint32 cc;               /* Faster than pcre_uchar */
   
3458            RMATCH(eptr, ecode, offset_top, md, eptrb, RM24);            RMATCH(eptr, ecode, offset_top, md, eptrb, RM24);
3459            if (rrc != MATCH_NOMATCH) RRETURN(rrc);            if (rrc != MATCH_NOMATCH) RRETURN(rrc);
3460            if (fi >= max) RRETURN(MATCH_NOMATCH);            if (fi >= max) RRETURN(MATCH_NOMATCH);
# Line 3476  for (;;) Line 3474  for (;;)
3474          pp = eptr;          pp = eptr;
3475          for (i = min; i < max; i++)          for (i = min; i < max; i++)
3476            {            {
3477            pcre_uchar cc;            pcre_uint32 cc;               /* Faster than pcre_uchar */
   
3478            if (eptr >= md->end_subject)            if (eptr >= md->end_subject)
3479              {              {
3480              SCHECK_PARTIAL();              SCHECK_PARTIAL();
# Line 4203  for (;;) Line 4200  for (;;)
4200                RRETURN(MATCH_NOMATCH);                RRETURN(MATCH_NOMATCH);
4201              }              }
4202            break;            break;
4203    
4204            case PT_CLIST:            case PT_CLIST:
4205            for (i = 1; i <= min; i++)            for (i = 1; i <= min; i++)
4206              {              {
4207              const pcre_uint32 *cp;              const pcre_uint32 *cp;
4208              if (eptr >= md->end_subject)              if (eptr >= md->end_subject)
4209                {                {
# Line 4214  for (;;) Line 4211  for (;;)
4211                RRETURN(MATCH_NOMATCH);                RRETURN(MATCH_NOMATCH);
4212                }                }
4213              GETCHARINCTEST(c, eptr);              GETCHARINCTEST(c, eptr);
4214              cp = PRIV(ucd_caseless_sets) + UCD_CASESET(c);              cp = PRIV(ucd_caseless_sets) + prop_value;
4215              for (;;)              for (;;)
4216                {                {
4217                if (c < *cp)                if (c < *cp)
4218                  { if (prop_fail_result) break; else { RRETURN(MATCH_NOMATCH); } }                  { if (prop_fail_result) break; else { RRETURN(MATCH_NOMATCH); } }
4219                if (c == *cp++)                if (c == *cp++)
4220                  { if (prop_fail_result) { RRETURN(MATCH_NOMATCH); } else break; }                  { if (prop_fail_result) { RRETURN(MATCH_NOMATCH); } else break; }
4221                }                }
4222              }              }
4223            break;            break;
4224    
4225            /* This should not occur */            /* This should not occur */
4226    
4227            default:            default:
# Line 4954  for (;;) Line 4951  for (;;)
4951    
4952            case PT_CLIST:            case PT_CLIST:
4953            for (fi = min;; fi++)            for (fi = min;; fi++)
4954              {              {
4955              const pcre_uint32 *cp;              const pcre_uint32 *cp;
4956              RMATCH(eptr, ecode, offset_top, md, eptrb, RM62);              RMATCH(eptr, ecode, offset_top, md, eptrb, RM67);
4957              if (rrc != MATCH_NOMATCH) RRETURN(rrc);              if (rrc != MATCH_NOMATCH) RRETURN(rrc);
4958              if (fi >= max) RRETURN(MATCH_NOMATCH);              if (fi >= max) RRETURN(MATCH_NOMATCH);
4959              if (eptr >= md->end_subject)              if (eptr >= md->end_subject)
# Line 4965  for (;;) Line 4962  for (;;)
4962                RRETURN(MATCH_NOMATCH);                RRETURN(MATCH_NOMATCH);
4963                }                }
4964              GETCHARINCTEST(c, eptr);              GETCHARINCTEST(c, eptr);
4965              cp = PRIV(ucd_caseless_sets) + UCD_CASESET(c);              cp = PRIV(ucd_caseless_sets) + prop_value;
4966              for (;;)              for (;;)
4967                {                {
4968                if (c < *cp)                if (c < *cp)
# Line 5445  for (;;) Line 5442  for (;;)
5442              eptr+= len;              eptr+= len;
5443              }              }
5444            break;            break;
5445    
5446            case PT_CLIST:            case PT_CLIST:
5447            for (i = min; i < max; i++)            for (i = min; i < max; i++)
5448              {              {
# Line 5457  for (;;) Line 5454  for (;;)
5454                break;                break;
5455                }                }
5456              GETCHARLENTEST(c, eptr, len);              GETCHARLENTEST(c, eptr, len);
5457              cp = PRIV(ucd_caseless_sets) + UCD_CASESET(c);              cp = PRIV(ucd_caseless_sets) + prop_value;
5458              for (;;)              for (;;)
5459                {                {
5460                if (c < *cp)                if (c < *cp)
5461                  { if (prop_fail_result) break; else goto GOT_MAX; }                  { if (prop_fail_result) break; else goto GOT_MAX; }
5462                if (c == *cp++)                if (c == *cp++)
5463                  { if (prop_fail_result) goto GOT_MAX; else break; }                  { if (prop_fail_result) goto GOT_MAX; else break; }
5464                }                }
5465              eptr += len;              eptr += len;
5466              }              }
5467            GOT_MAX:            GOT_MAX:
5468            break;            break;
5469    
5470            default:            default:
# Line 6111  switch (frame->Xwhere) Line 6108  switch (frame->Xwhere)
6108    LBL(32) LBL(34) LBL(42) LBL(46)    LBL(32) LBL(34) LBL(42) LBL(46)
6109  #ifdef SUPPORT_UCP  #ifdef SUPPORT_UCP
6110    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)
6111    LBL(59) LBL(60) LBL(61) LBL(62)    LBL(59) LBL(60) LBL(61) LBL(62) LBL(67)
6112  #endif  /* SUPPORT_UCP */  #endif  /* SUPPORT_UCP */
6113  #endif  /* SUPPORT_UTF */  #endif  /* SUPPORT_UTF */
6114    default:    default:
6115    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);  
   
6116    return PCRE_ERROR_INTERNAL;    return PCRE_ERROR_INTERNAL;
6117    }    }
6118  #undef LBL  #undef LBL
# Line 6298  if ((options & ~PUBLIC_EXEC_OPTIONS) != Line 6292  if ((options & ~PUBLIC_EXEC_OPTIONS) !=
6292  if (re == NULL || subject == NULL || (offsets == NULL && offsetcount > 0))  if (re == NULL || subject == NULL || (offsets == NULL && offsetcount > 0))
6293    return PCRE_ERROR_NULL;    return PCRE_ERROR_NULL;
6294  if (offsetcount < 0) return PCRE_ERROR_BADCOUNT;  if (offsetcount < 0) return PCRE_ERROR_BADCOUNT;
6295    if (length < 0) return PCRE_ERROR_BADLENGTH;
6296  if (start_offset < 0 || start_offset > length) return PCRE_ERROR_BADOFFSET;  if (start_offset < 0 || start_offset > length) return PCRE_ERROR_BADOFFSET;
6297    
6298  /* 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 6359  if (extra_data != NULL
6359      && (extra_data->flags & (PCRE_EXTRA_EXECUTABLE_JIT |      && (extra_data->flags & (PCRE_EXTRA_EXECUTABLE_JIT |
6360                               PCRE_EXTRA_TABLES)) == PCRE_EXTRA_EXECUTABLE_JIT                               PCRE_EXTRA_TABLES)) == PCRE_EXTRA_EXECUTABLE_JIT
6361      && extra_data->executable_jit != NULL      && extra_data->executable_jit != NULL
6362      && (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)  
6363    {    {
6364    rc = PRIV(jit_exec)(re, extra_data, (const pcre_uchar *)subject, length,    rc = PRIV(jit_exec)(extra_data, (const pcre_uchar *)subject, length,
6365         start_offset, options, offsets, offsetcount);         start_offset, options, offsets, offsetcount);
6366    
6367    /* PCRE_ERROR_NULL means that the selected normal or partial matching    /* PCRE_ERROR_NULL means that the selected normal or partial matching
6368    mode is not compiled. In this case we simply fallback to interpreter. */    mode is not compiled. In this case we simply fallback to interpreter. */
6369    
6370    if (rc != PCRE_ERROR_NULL) return rc;    if (rc != PCRE_ERROR_JIT_BADOPTION) return rc;
6371    }    }
6372  #endif  #endif
6373    

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

  ViewVC Help
Powered by ViewVC 1.1.5