/[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 763 by ph10, Mon Nov 21 10:48:42 2011 UTC revision 764 by zherczeg, Wed Nov 23 17:23:20 2011 UTC
# Line 189  for (;;) Line 189  for (;;)
189      case OP_DOLLM:      case OP_DOLLM:
190      case OP_NOT_WORD_BOUNDARY:      case OP_NOT_WORD_BOUNDARY:
191      case OP_WORD_BOUNDARY:      case OP_WORD_BOUNDARY:
192      cc += _pcre_OP_lengths[*cc];      cc += PRIV(OP_lengths)[*cc];
193      break;      break;
194    
195      /* Skip over a subpattern that has a {0} or {0,x} quantifier */      /* Skip over a subpattern that has a {0} or {0,x} quantifier */
# Line 198  for (;;) Line 198  for (;;)
198      case OP_BRAMINZERO:      case OP_BRAMINZERO:
199      case OP_BRAPOSZERO:      case OP_BRAPOSZERO:
200      case OP_SKIPZERO:      case OP_SKIPZERO:
201      cc += _pcre_OP_lengths[*cc];      cc += PRIV(OP_lengths)[*cc];
202      do cc += GET(cc, 1); while (*cc == OP_ALT);      do cc += GET(cc, 1); while (*cc == OP_ALT);
203      cc += 1 + LINK_SIZE;      cc += 1 + LINK_SIZE;
204      break;      break;
# Line 224  for (;;) Line 224  for (;;)
224      branchlength++;      branchlength++;
225      cc += 2;      cc += 2;
226  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
227      if (utf8 && cc[-1] >= 0xc0) cc += _pcre_utf8_table4[cc[-1] & 0x3f];      if (utf8 && cc[-1] >= 0xc0) cc += PRIV(utf8_table4)[cc[-1] & 0x3f];
228  #endif  #endif
229      break;      break;
230    
# Line 245  for (;;) Line 245  for (;;)
245      branchlength += GET2(cc,1);      branchlength += GET2(cc,1);
246      cc += 4;      cc += 4;
247  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
248      if (utf8 && cc[-1] >= 0xc0) cc += _pcre_utf8_table4[cc[-1] & 0x3f];      if (utf8 && cc[-1] >= 0xc0) cc += PRIV(utf8_table4)[cc[-1] & 0x3f];
249  #endif  #endif
250      break;      break;
251    
# Line 308  for (;;) Line 308  for (;;)
308      case OP_TYPEPOSSTAR:      case OP_TYPEPOSSTAR:
309      case OP_TYPEPOSQUERY:      case OP_TYPEPOSQUERY:
310      if (cc[1] == OP_PROP || cc[1] == OP_NOTPROP) cc += 2;      if (cc[1] == OP_PROP || cc[1] == OP_NOTPROP) cc += 2;
311      cc += _pcre_OP_lengths[op];      cc += PRIV(OP_lengths)[op];
312      break;      break;
313    
314      case OP_TYPEUPTO:      case OP_TYPEUPTO:
315      case OP_TYPEMINUPTO:      case OP_TYPEMINUPTO:
316      case OP_TYPEPOSUPTO:      case OP_TYPEPOSUPTO:
317      if (cc[3] == OP_PROP || cc[3] == OP_NOTPROP) cc += 2;      if (cc[3] == OP_PROP || cc[3] == OP_NOTPROP) cc += 2;
318      cc += _pcre_OP_lengths[op];      cc += PRIV(OP_lengths)[op];
319      break;      break;
320    
321      /* Check a class for variable quantification */      /* Check a class for variable quantification */
# Line 372  for (;;) Line 372  for (;;)
372      case OP_REFI:      case OP_REFI:
373      if ((options & PCRE_JAVASCRIPT_COMPAT) == 0)      if ((options & PCRE_JAVASCRIPT_COMPAT) == 0)
374        {        {
375        ce = cs = (pcre_uchar *)_pcre_find_bracket(startcode, utf8, GET2(cc, 1));        ce = cs = (pcre_uchar *)PRIV(find_bracket)(startcode, utf8, GET2(cc, 1));
376        if (cs == NULL) return -2;        if (cs == NULL) return -2;
377        do ce += GET(ce, 1); while (*ce == OP_ALT);        do ce += GET(ce, 1); while (*ce == OP_ALT);
378        if (cc > cs && cc < ce)        if (cc > cs && cc < ce)
# Line 482  for (;;) Line 482  for (;;)
482      case OP_NOTPOSQUERY:      case OP_NOTPOSQUERY:
483      case OP_NOTPOSQUERYI:      case OP_NOTPOSQUERYI:
484    
485      cc += _pcre_OP_lengths[op];      cc += PRIV(OP_lengths)[op];
486  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
487      if (utf8 && cc[-1] >= 0xc0) cc += _pcre_utf8_table4[cc[-1] & 0x3f];      if (utf8 && cc[-1] >= 0xc0) cc += PRIV(utf8_table4)[cc[-1] & 0x3f];
488  #endif  #endif
489      break;      break;
490    
# Line 494  for (;;) Line 494  for (;;)
494      case OP_PRUNE_ARG:      case OP_PRUNE_ARG:
495      case OP_SKIP_ARG:      case OP_SKIP_ARG:
496      case OP_THEN_ARG:      case OP_THEN_ARG:
497      cc += _pcre_OP_lengths[op] + cc[1];      cc += PRIV(OP_lengths)[op] + cc[1];
498      break;      break;
499    
500      /* The remaining opcodes are just skipped over. */      /* The remaining opcodes are just skipped over. */
# Line 506  for (;;) Line 506  for (;;)
506      case OP_SET_SOM:      case OP_SET_SOM:
507      case OP_SKIP:      case OP_SKIP:
508      case OP_THEN:      case OP_THEN:
509      cc += _pcre_OP_lengths[op];      cc += PRIV(OP_lengths)[op];
510      break;      break;
511    
512      /* This should not occur: we list all opcodes explicitly so that when      /* This should not occur: we list all opcodes explicitly so that when
# Line 557  if (utf8 && c > 127) Line 557  if (utf8 && c > 127)
557      {      {
558      pcre_uint8 buff[8];      pcre_uint8 buff[8];
559      c = UCD_OTHERCASE(c);      c = UCD_OTHERCASE(c);
560      (void)_pcre_ord2utf8(c, buff);      (void)PRIV(ord2utf8)(c, buff);
561      SET_BIT(buff[0]);      SET_BIT(buff[0]);
562      }      }
563  #endif  #endif
# Line 605  for (c = 128; c < 256; c++) Line 605  for (c = 128; c < 256; c++)
605    if ((cd->cbits[c/8] & (1 << (c&7))) != 0)    if ((cd->cbits[c/8] & (1 << (c&7))) != 0)
606      {      {
607      pcre_uint8 buff[8];      pcre_uint8 buff[8];
608      (void)_pcre_ord2utf8(c, buff);      (void)PRIV(ord2utf8)(c, buff);
609      SET_BIT(buff[0]);      SET_BIT(buff[0]);
610      }      }
611    }    }
# Line 1346  if (bits_set || min > 0 Line 1346  if (bits_set || min > 0
1346    
1347  #ifdef SUPPORT_JIT  #ifdef SUPPORT_JIT
1348    extra->executable_jit = NULL;    extra->executable_jit = NULL;
1349    if ((options & PCRE_STUDY_JIT_COMPILE) != 0) _pcre_jit_compile(re, extra);    if ((options & PCRE_STUDY_JIT_COMPILE) != 0) PRIV(jit_compile)(re, extra);
1350    if (study->flags == 0 && (extra->flags & PCRE_EXTRA_EXECUTABLE_JIT) == 0)    if (study->flags == 0 && (extra->flags & PCRE_EXTRA_EXECUTABLE_JIT) == 0)
1351      {      {
1352      pcre_free_study(extra);      pcre_free_study(extra);
# Line 1375  pcre_free_study(pcre_extra *extra) Line 1375  pcre_free_study(pcre_extra *extra)
1375  #ifdef SUPPORT_JIT  #ifdef SUPPORT_JIT
1376  if ((extra->flags & PCRE_EXTRA_EXECUTABLE_JIT) != 0 &&  if ((extra->flags & PCRE_EXTRA_EXECUTABLE_JIT) != 0 &&
1377       extra->executable_jit != NULL)       extra->executable_jit != NULL)
1378    _pcre_jit_free(extra->executable_jit);    PRIV(jit_free)(extra->executable_jit);
1379  #endif  #endif
1380  pcre_free(extra);  pcre_free(extra);
1381  }  }

Legend:
Removed from v.763  
changed lines
  Added in v.764

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12