/[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 922 by ph10, Mon Feb 20 18:44:42 2012 UTC revision 926 by ph10, Wed Feb 22 15:01:32 2012 UTC
# Line 3565  for (;;) Line 3565  for (;;)
3565        SCHECK_PARTIAL();        SCHECK_PARTIAL();
3566        RRETURN(MATCH_NOMATCH);        RRETURN(MATCH_NOMATCH);
3567        }        }
3568      ecode++;  #ifdef SUPPORT_UTF
3569      GETCHARINCTEST(c, eptr);      if (utf)
     if (op == OP_NOTI)         /* The caseless case */  
3570        {        {
3571        register unsigned int ch, och;        register unsigned int ch, och;
3572        ch = *ecode++;  
3573  #ifdef COMPILE_PCRE8        ecode++;
3574        /* ch must be < 128 if UTF is enabled. */        GETCHARINC(ch, ecode);
3575        och = md->fcc[ch];        GETCHARINC(c, eptr);
3576  #else  
3577  #ifdef SUPPORT_UTF        if (op == OP_NOT)
3578            {
3579            if (ch == c) RRETURN(MATCH_NOMATCH);
3580            }
3581          else
3582            {
3583  #ifdef SUPPORT_UCP  #ifdef SUPPORT_UCP
3584        if (utf && ch > 127)          if (ch > 127)
3585          och = UCD_OTHERCASE(ch);            och = UCD_OTHERCASE(ch);
3586  #else  #else
3587        if (utf && ch > 127)          if (ch > 127)
3588          och = ch;            och = ch;
3589  #endif /* SUPPORT_UCP */  #endif /* SUPPORT_UCP */
3590        else          else
3591  #endif /* SUPPORT_UTF */            och = TABLE_GET(ch, md->fcc, ch);
3592          och = TABLE_GET(ch, md->fcc, ch);          if (ch == c || och == c) RRETURN(MATCH_NOMATCH);
3593  #endif /* COMPILE_PCRE8 */          }
       if (ch == c || och == c) RRETURN(MATCH_NOMATCH);  
3594        }        }
3595      else    /* Caseful */      else
3596    #endif
3597        {        {
3598        if (*ecode++ == c) RRETURN(MATCH_NOMATCH);        register unsigned int ch = ecode[1];
3599          c = *eptr++;
3600          if (ch == c || (op == OP_NOTI && TABLE_GET(ch, md->fcc, ch) == c))
3601            RRETURN(MATCH_NOMATCH);
3602          ecode += 2;
3603        }        }
3604      break;      break;
3605    
# Line 3671  for (;;) Line 3679  for (;;)
3679      /* Common code for all repeated single-byte matches. */      /* Common code for all repeated single-byte matches. */
3680    
3681      REPEATNOTCHAR:      REPEATNOTCHAR:
3682      fc = *ecode++;      GETCHARINCTEST(fc, ecode);
3683    
3684      /* The code is duplicated for the caseless and caseful cases, for speed,      /* The code is duplicated for the caseless and caseful cases, for speed,
3685      since matching characters is likely to be quite common. First, ensure the      since matching characters is likely to be quite common. First, ensure the
# Line 3686  for (;;) Line 3694  for (;;)
3694    
3695      if (op >= OP_NOTSTARI)     /* Caseless */      if (op >= OP_NOTSTARI)     /* Caseless */
3696        {        {
 #ifdef COMPILE_PCRE8  
       /* fc must be < 128 if UTF is enabled. */  
       foc = md->fcc[fc];  
 #else  
3697  #ifdef SUPPORT_UTF  #ifdef SUPPORT_UTF
3698  #ifdef SUPPORT_UCP  #ifdef SUPPORT_UCP
3699        if (utf && fc > 127)        if (utf && fc > 127)
# Line 3701  for (;;) Line 3705  for (;;)
3705        else        else
3706  #endif /* SUPPORT_UTF */  #endif /* SUPPORT_UTF */
3707          foc = TABLE_GET(fc, md->fcc, fc);          foc = TABLE_GET(fc, md->fcc, fc);
 #endif /* COMPILE_PCRE8 */  
3708    
3709  #ifdef SUPPORT_UTF  #ifdef SUPPORT_UTF
3710        if (utf)        if (utf)
# Line 3715  for (;;) Line 3718  for (;;)
3718              RRETURN(MATCH_NOMATCH);              RRETURN(MATCH_NOMATCH);
3719              }              }
3720            GETCHARINC(d, eptr);            GETCHARINC(d, eptr);
3721            if (fc == d || (unsigned int) foc == d) RRETURN(MATCH_NOMATCH);            if (fc == d || (unsigned int)foc == d) RRETURN(MATCH_NOMATCH);
3722            }            }
3723          }          }
3724        else        else
# Line 6432  if (extra_data != NULL Line 6435  if (extra_data != NULL
6435    /* PCRE_ERROR_NULL means that the selected normal or partial matching    /* PCRE_ERROR_NULL means that the selected normal or partial matching
6436    mode is not compiled. In this case we simply fallback to interpreter. */    mode is not compiled. In this case we simply fallback to interpreter. */
6437    
6438    if (rc != PCRE_ERROR_NULL)     /* JIT was used */    if (rc != PCRE_ERROR_NULL) return rc;
     {  
     ((pcre_extra *)extra_data)->flags |= PCRE_EXTRA_USED_JIT;  
     return rc;  
     }  
6439    }    }
6440  #endif  #endif
6441    
# Line 6471  if (extra_data != NULL) Line 6470  if (extra_data != NULL)
6470    if ((flags & PCRE_EXTRA_CALLOUT_DATA) != 0)    if ((flags & PCRE_EXTRA_CALLOUT_DATA) != 0)
6471      md->callout_data = extra_data->callout_data;      md->callout_data = extra_data->callout_data;
6472    if ((flags & PCRE_EXTRA_TABLES) != 0) tables = extra_data->tables;    if ((flags & PCRE_EXTRA_TABLES) != 0) tables = extra_data->tables;
   ((pcre_extra *)extra_data)->flags &= ~PCRE_EXTRA_USED_JIT;   /* JIT not used */  
6473    }    }
6474    
6475  /* If the exec call supplied NULL for tables, use the inbuilt ones. This  /* If the exec call supplied NULL for tables, use the inbuilt ones. This

Legend:
Removed from v.922  
changed lines
  Added in v.926

  ViewVC Help
Powered by ViewVC 1.1.5