/[pcre]/code/trunk/pcre_study.c
ViewVC logotype

Diff of /code/trunk/pcre_study.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 230 by ph10, Mon Sep 10 13:23:56 2007 UTC revision 730 by ph10, Mon Oct 10 16:07:02 2011 UTC
# Line 6  Line 6 
6  and semantics are as close as possible to those of the Perl 5 language.  and semantics are as close as possible to those of the Perl 5 language.
7    
8                         Written by Philip Hazel                         Written by Philip Hazel
9             Copyright (c) 1997-2007 University of Cambridge             Copyright (c) 1997-2010 University of Cambridge
10    
11  -----------------------------------------------------------------------------  -----------------------------------------------------------------------------
12  Redistribution and use in source and binary forms, with or without  Redistribution and use in source and binary forms, with or without
# Line 43  supporting functions. */ Line 43  supporting functions. */
43    
44    
45  #ifdef HAVE_CONFIG_H  #ifdef HAVE_CONFIG_H
46  #include <config.h>  #include "config.h"
47  #endif  #endif
48    
49  #include "pcre_internal.h"  #include "pcre_internal.h"
50    
51    #define SET_BIT(c) start_bits[c/8] |= (1 << (c&7))
52    
53  /* Returns from set_start_bits() */  /* Returns from set_start_bits() */
54    
55  enum { SSB_FAIL, SSB_DONE, SSB_CONTINUE };  enum { SSB_FAIL, SSB_DONE, SSB_CONTINUE, SSB_UNKNOWN };
56    
57    
58    
59    /*************************************************
60    *   Find the minimum subject length for a group  *
61    *************************************************/
62    
63    /* Scan a parenthesized group and compute the minimum length of subject that
64    is needed to match it. This is a lower bound; it does not mean there is a
65    string of that length that matches. In UTF8 mode, the result is in characters
66    rather than bytes.
67    
68    Arguments:
69      code            pointer to start of group (the bracket)
70      startcode       pointer to start of the whole pattern
71      options         the compiling options
72      int             RECURSE depth
73    
74    Returns:   the minimum length
75               -1 if \C in UTF-8 mode or (*ACCEPT) was encountered
76               -2 internal error (missing capturing bracket)
77               -3 internal error (opcode not listed)
78    */
79    
80    static int
81    find_minlength(const uschar *code, const uschar *startcode, int options,
82      int recurse_depth)
83    {
84    int length = -1;
85    BOOL utf8 = (options & PCRE_UTF8) != 0;
86    BOOL had_recurse = FALSE;
87    register int branchlength = 0;
88    register uschar *cc = (uschar *)code + 1 + LINK_SIZE;
89    
90    if (*code == OP_CBRA || *code == OP_SCBRA ||
91        *code == OP_CBRAPOS || *code == OP_SCBRAPOS) cc += 2;
92    
93    /* Scan along the opcodes for this branch. If we get to the end of the
94    branch, check the length against that of the other branches. */
95    
96    for (;;)
97      {
98      int d, min;
99      uschar *cs, *ce;
100      register int op = *cc;
101    
102      switch (op)
103        {
104        case OP_COND:
105        case OP_SCOND:
106    
107        /* If there is only one branch in a condition, the implied branch has zero
108        length, so we don't add anything. This covers the DEFINE "condition"
109        automatically. */
110    
111        cs = cc + GET(cc, 1);
112        if (*cs != OP_ALT)
113          {
114          cc = cs + 1 + LINK_SIZE;
115          break;
116          }
117    
118        /* Otherwise we can fall through and treat it the same as any other
119        subpattern. */
120    
121        case OP_CBRA:
122        case OP_SCBRA:
123        case OP_BRA:
124        case OP_SBRA:
125        case OP_CBRAPOS:
126        case OP_SCBRAPOS:
127        case OP_BRAPOS:
128        case OP_SBRAPOS:
129        case OP_ONCE:
130        case OP_ONCE_NC:
131        d = find_minlength(cc, startcode, options, recurse_depth);
132        if (d < 0) return d;
133        branchlength += d;
134        do cc += GET(cc, 1); while (*cc == OP_ALT);
135        cc += 1 + LINK_SIZE;
136        break;
137    
138        /* ACCEPT makes things far too complicated; we have to give up. */
139    
140        case OP_ACCEPT:
141        case OP_ASSERT_ACCEPT:
142        return -1;
143    
144        /* Reached end of a branch; if it's a ket it is the end of a nested
145        call. If it's ALT it is an alternation in a nested call. If it is END it's
146        the end of the outer call. All can be handled by the same code. If an
147        ACCEPT was previously encountered, use the length that was in force at that
148        time, and pass back the shortest ACCEPT length. */
149    
150        case OP_ALT:
151        case OP_KET:
152        case OP_KETRMAX:
153        case OP_KETRMIN:
154        case OP_KETRPOS:
155        case OP_END:
156        if (length < 0 || (!had_recurse && branchlength < length))
157          length = branchlength;
158        if (op != OP_ALT) return length;
159        cc += 1 + LINK_SIZE;
160        branchlength = 0;
161        had_recurse = FALSE;
162        break;
163    
164        /* Skip over assertive subpatterns */
165    
166        case OP_ASSERT:
167        case OP_ASSERT_NOT:
168        case OP_ASSERTBACK:
169        case OP_ASSERTBACK_NOT:
170        do cc += GET(cc, 1); while (*cc == OP_ALT);
171        /* Fall through */
172    
173        /* Skip over things that don't match chars */
174    
175        case OP_REVERSE:
176        case OP_CREF:
177        case OP_NCREF:
178        case OP_RREF:
179        case OP_NRREF:
180        case OP_DEF:
181        case OP_CALLOUT:
182        case OP_SOD:
183        case OP_SOM:
184        case OP_EOD:
185        case OP_EODN:
186        case OP_CIRC:
187        case OP_CIRCM:
188        case OP_DOLL:
189        case OP_DOLLM:
190        case OP_NOT_WORD_BOUNDARY:
191        case OP_WORD_BOUNDARY:
192        cc += _pcre_OP_lengths[*cc];
193        break;
194    
195        /* Skip over a subpattern that has a {0} or {0,x} quantifier */
196    
197        case OP_BRAZERO:
198        case OP_BRAMINZERO:
199        case OP_BRAPOSZERO:
200        case OP_SKIPZERO:
201        cc += _pcre_OP_lengths[*cc];
202        do cc += GET(cc, 1); while (*cc == OP_ALT);
203        cc += 1 + LINK_SIZE;
204        break;
205    
206        /* Handle literal characters and + repetitions */
207    
208        case OP_CHAR:
209        case OP_CHARI:
210        case OP_NOT:
211        case OP_NOTI:
212        case OP_PLUS:
213        case OP_PLUSI:
214        case OP_MINPLUS:
215        case OP_MINPLUSI:
216        case OP_POSPLUS:
217        case OP_POSPLUSI:
218        case OP_NOTPLUS:
219        case OP_NOTPLUSI:
220        case OP_NOTMINPLUS:
221        case OP_NOTMINPLUSI:
222        case OP_NOTPOSPLUS:
223        case OP_NOTPOSPLUSI:
224        branchlength++;
225        cc += 2;
226    #ifdef SUPPORT_UTF8
227        if (utf8 && cc[-1] >= 0xc0) cc += _pcre_utf8_table4[cc[-1] & 0x3f];
228    #endif
229        break;
230    
231        case OP_TYPEPLUS:
232        case OP_TYPEMINPLUS:
233        case OP_TYPEPOSPLUS:
234        branchlength++;
235        cc += (cc[1] == OP_PROP || cc[1] == OP_NOTPROP)? 4 : 2;
236        break;
237    
238        /* Handle exact repetitions. The count is already in characters, but we
239        need to skip over a multibyte character in UTF8 mode.  */
240    
241        case OP_EXACT:
242        case OP_EXACTI:
243        case OP_NOTEXACT:
244        case OP_NOTEXACTI:
245        branchlength += GET2(cc,1);
246        cc += 4;
247    #ifdef SUPPORT_UTF8
248        if (utf8 && cc[-1] >= 0xc0) cc += _pcre_utf8_table4[cc[-1] & 0x3f];
249    #endif
250        break;
251    
252        case OP_TYPEEXACT:
253        branchlength += GET2(cc,1);
254        cc += (cc[3] == OP_PROP || cc[3] == OP_NOTPROP)? 6 : 4;
255        break;
256    
257        /* Handle single-char non-literal matchers */
258    
259        case OP_PROP:
260        case OP_NOTPROP:
261        cc += 2;
262        /* Fall through */
263    
264        case OP_NOT_DIGIT:
265        case OP_DIGIT:
266        case OP_NOT_WHITESPACE:
267        case OP_WHITESPACE:
268        case OP_NOT_WORDCHAR:
269        case OP_WORDCHAR:
270        case OP_ANY:
271        case OP_ALLANY:
272        case OP_EXTUNI:
273        case OP_HSPACE:
274        case OP_NOT_HSPACE:
275        case OP_VSPACE:
276        case OP_NOT_VSPACE:
277        branchlength++;
278        cc++;
279        break;
280    
281        /* "Any newline" might match two characters, but it also might match just
282        one. */
283    
284        case OP_ANYNL:
285        branchlength += 1;
286        cc++;
287        break;
288    
289        /* The single-byte matcher means we can't proceed in UTF-8 mode */
290    
291        case OP_ANYBYTE:
292    #ifdef SUPPORT_UTF8
293        if (utf8) return -1;
294    #endif
295        branchlength++;
296        cc++;
297        break;
298    
299        /* For repeated character types, we have to test for \p and \P, which have
300        an extra two bytes of parameters. */
301    
302        case OP_TYPESTAR:
303        case OP_TYPEMINSTAR:
304        case OP_TYPEQUERY:
305        case OP_TYPEMINQUERY:
306        case OP_TYPEPOSSTAR:
307        case OP_TYPEPOSQUERY:
308        if (cc[1] == OP_PROP || cc[1] == OP_NOTPROP) cc += 2;
309        cc += _pcre_OP_lengths[op];
310        break;
311    
312        case OP_TYPEUPTO:
313        case OP_TYPEMINUPTO:
314        case OP_TYPEPOSUPTO:
315        if (cc[3] == OP_PROP || cc[3] == OP_NOTPROP) cc += 2;
316        cc += _pcre_OP_lengths[op];
317        break;
318    
319        /* Check a class for variable quantification */
320    
321    #ifdef SUPPORT_UTF8
322        case OP_XCLASS:
323        cc += GET(cc, 1) - 33;
324        /* Fall through */
325    #endif
326    
327        case OP_CLASS:
328        case OP_NCLASS:
329        cc += 33;
330    
331        switch (*cc)
332          {
333          case OP_CRPLUS:
334          case OP_CRMINPLUS:
335          branchlength++;
336          /* Fall through */
337    
338          case OP_CRSTAR:
339          case OP_CRMINSTAR:
340          case OP_CRQUERY:
341          case OP_CRMINQUERY:
342          cc++;
343          break;
344    
345          case OP_CRRANGE:
346          case OP_CRMINRANGE:
347          branchlength += GET2(cc,1);
348          cc += 5;
349          break;
350    
351          default:
352          branchlength++;
353          break;
354          }
355        break;
356    
357        /* Backreferences and subroutine calls are treated in the same way: we find
358        the minimum length for the subpattern. A recursion, however, causes an
359        a flag to be set that causes the length of this branch to be ignored. The
360        logic is that a recursion can only make sense if there is another
361        alternation that stops the recursing. That will provide the minimum length
362        (when no recursion happens). A backreference within the group that it is
363        referencing behaves in the same way.
364    
365        If PCRE_JAVASCRIPT_COMPAT is set, a backreference to an unset bracket
366        matches an empty string (by default it causes a matching failure), so in
367        that case we must set the minimum length to zero. */
368    
369        case OP_REF:
370        case OP_REFI:
371        if ((options & PCRE_JAVASCRIPT_COMPAT) == 0)
372          {
373          ce = cs = (uschar *)_pcre_find_bracket(startcode, utf8, GET2(cc, 1));
374          if (cs == NULL) return -2;
375          do ce += GET(ce, 1); while (*ce == OP_ALT);
376          if (cc > cs && cc < ce)
377            {
378            d = 0;
379            had_recurse = TRUE;
380            }
381          else
382            {
383            d = find_minlength(cs, startcode, options, recurse_depth);
384            }
385          }
386        else d = 0;
387        cc += 3;
388    
389        /* Handle repeated back references */
390    
391        switch (*cc)
392          {
393          case OP_CRSTAR:
394          case OP_CRMINSTAR:
395          case OP_CRQUERY:
396          case OP_CRMINQUERY:
397          min = 0;
398          cc++;
399          break;
400    
401          case OP_CRPLUS:
402          case OP_CRMINPLUS:
403          min = 1;
404          cc++;
405          break;
406    
407          case OP_CRRANGE:
408          case OP_CRMINRANGE:
409          min = GET2(cc, 1);
410          cc += 5;
411          break;
412    
413          default:
414          min = 1;
415          break;
416          }
417    
418        branchlength += min * d;
419        break;
420    
421        /* We can easily detect direct recursion, but not mutual recursion. This is
422        caught by a recursion depth count. */
423    
424        case OP_RECURSE:
425        cs = ce = (uschar *)startcode + GET(cc, 1);
426        do ce += GET(ce, 1); while (*ce == OP_ALT);
427        if ((cc > cs && cc < ce) || recurse_depth > 10)
428          had_recurse = TRUE;
429        else
430          {
431          branchlength += find_minlength(cs, startcode, options, recurse_depth + 1);
432          }
433        cc += 1 + LINK_SIZE;
434        break;
435    
436        /* Anything else does not or need not match a character. We can get the
437        item's length from the table, but for those that can match zero occurrences
438        of a character, we must take special action for UTF-8 characters. As it
439        happens, the "NOT" versions of these opcodes are used at present only for
440        ASCII characters, so they could be omitted from this list. However, in
441        future that may change, so we include them here so as not to leave a
442        gotcha for a future maintainer. */
443    
444        case OP_UPTO:
445        case OP_UPTOI:
446        case OP_NOTUPTO:
447        case OP_NOTUPTOI:
448        case OP_MINUPTO:
449        case OP_MINUPTOI:
450        case OP_NOTMINUPTO:
451        case OP_NOTMINUPTOI:
452        case OP_POSUPTO:
453        case OP_POSUPTOI:
454        case OP_NOTPOSUPTO:
455        case OP_NOTPOSUPTOI:
456    
457        case OP_STAR:
458        case OP_STARI:
459        case OP_NOTSTAR:
460        case OP_NOTSTARI:
461        case OP_MINSTAR:
462        case OP_MINSTARI:
463        case OP_NOTMINSTAR:
464        case OP_NOTMINSTARI:
465        case OP_POSSTAR:
466        case OP_POSSTARI:
467        case OP_NOTPOSSTAR:
468        case OP_NOTPOSSTARI:
469    
470        case OP_QUERY:
471        case OP_QUERYI:
472        case OP_NOTQUERY:
473        case OP_NOTQUERYI:
474        case OP_MINQUERY:
475        case OP_MINQUERYI:
476        case OP_NOTMINQUERY:
477        case OP_NOTMINQUERYI:
478        case OP_POSQUERY:
479        case OP_POSQUERYI:
480        case OP_NOTPOSQUERY:
481        case OP_NOTPOSQUERYI:
482    
483        cc += _pcre_OP_lengths[op];
484    #ifdef SUPPORT_UTF8
485        if (utf8 && cc[-1] >= 0xc0) cc += _pcre_utf8_table4[cc[-1] & 0x3f];
486    #endif
487        break;
488    
489        /* Skip these, but we need to add in the name length. */
490    
491        case OP_MARK:
492        case OP_PRUNE_ARG:
493        case OP_SKIP_ARG:
494        case OP_THEN_ARG:
495        cc += _pcre_OP_lengths[op] + cc[1];
496        break;
497    
498        /* The remaining opcodes are just skipped over. */
499    
500        case OP_CLOSE:
501        case OP_COMMIT:
502        case OP_FAIL:
503        case OP_PRUNE:
504        case OP_SET_SOM:
505        case OP_SKIP:
506        case OP_THEN:
507        cc += _pcre_OP_lengths[op];
508        break;
509    
510        /* This should not occur: we list all opcodes explicitly so that when
511        new ones get added they are properly considered. */
512    
513        default:
514        return -3;
515        }
516      }
517    /* Control never gets here */
518    }
519    
520    
521    
522  /*************************************************  /*************************************************
523  *      Set a bit and maybe its alternate case    *  *      Set a bit and maybe its alternate case    *
524  *************************************************/  *************************************************/
525    
526  /* Given a character, set its bit in the table, and also the bit for the other  /* Given a character, set its first byte's bit in the table, and also the
527  version of a letter if we are caseless.  corresponding bit for the other version of a letter if we are caseless. In
528    UTF-8 mode, for characters greater than 127, we can only do the caseless thing
529    when Unicode property support is available.
530    
531  Arguments:  Arguments:
532    start_bits    points to the bit map    start_bits    points to the bit map
533    c             is the character    p             points to the character
534    caseless      the caseless flag    caseless      the caseless flag
535    cd            the block with char table pointers    cd            the block with char table pointers
536      utf8          TRUE for UTF-8 mode
537    
538  Returns:        nothing  Returns:        pointer after the character
539    */
540    
541    static const uschar *
542    set_table_bit(uschar *start_bits, const uschar *p, BOOL caseless,
543      compile_data *cd, BOOL utf8)
544    {
545    unsigned int c = *p;
546    
547    SET_BIT(c);
548    
549    #ifdef SUPPORT_UTF8
550    if (utf8 && c > 127)
551      {
552      GETCHARINC(c, p);
553    #ifdef SUPPORT_UCP
554      if (caseless)
555        {
556        uschar buff[8];
557        c = UCD_OTHERCASE(c);
558        (void)_pcre_ord2utf8(c, buff);
559        SET_BIT(buff[0]);
560        }
561    #endif
562      return p;
563      }
564    #endif
565    
566    /* Not UTF-8 mode, or character is less than 127. */
567    
568    if (caseless && (cd->ctypes[c] & ctype_letter) != 0) SET_BIT(cd->fcc[c]);
569    return p + 1;
570    }
571    
572    
573    
574    /*************************************************
575    *     Set bits for a positive character type     *
576    *************************************************/
577    
578    /* This function sets starting bits for a character type. In UTF-8 mode, we can
579    only do a direct setting for bytes less than 128, as otherwise there can be
580    confusion with bytes in the middle of UTF-8 characters. In a "traditional"
581    environment, the tables will only recognize ASCII characters anyway, but in at
582    least one Windows environment, some higher bytes bits were set in the tables.
583    So we deal with that case by considering the UTF-8 encoding.
584    
585    Arguments:
586      start_bits     the starting bitmap
587      cbit type      the type of character wanted
588      table_limit    32 for non-UTF-8; 16 for UTF-8
589      cd             the block with char table pointers
590    
591    Returns:         nothing
592  */  */
593    
594  static void  static void
595  set_bit(uschar *start_bits, unsigned int c, BOOL caseless, compile_data *cd)  set_type_bits(uschar *start_bits, int cbit_type, int table_limit,
596      compile_data *cd)
597  {  {
598  start_bits[c/8] |= (1 << (c&7));  register int c;
599  if (caseless && (cd->ctypes[c] & ctype_letter) != 0)  for (c = 0; c < table_limit; c++) start_bits[c] |= cd->cbits[c+cbit_type];
600    start_bits[cd->fcc[c]/8] |= (1 << (cd->fcc[c]&7));  if (table_limit == 32) return;
601    for (c = 128; c < 256; c++)
602      {
603      if ((cd->cbits[c/8] & (1 << (c&7))) != 0)
604        {
605        uschar buff[8];
606        (void)_pcre_ord2utf8(c, buff);
607        SET_BIT(buff[0]);
608        }
609      }
610    }
611    
612    
613    /*************************************************
614    *     Set bits for a negative character type     *
615    *************************************************/
616    
617    /* This function sets starting bits for a negative character type such as \D.
618    In UTF-8 mode, we can only do a direct setting for bytes less than 128, as
619    otherwise there can be confusion with bytes in the middle of UTF-8 characters.
620    Unlike in the positive case, where we can set appropriate starting bits for
621    specific high-valued UTF-8 characters, in this case we have to set the bits for
622    all high-valued characters. The lowest is 0xc2, but we overkill by starting at
623    0xc0 (192) for simplicity.
624    
625    Arguments:
626      start_bits     the starting bitmap
627      cbit type      the type of character wanted
628      table_limit    32 for non-UTF-8; 16 for UTF-8
629      cd             the block with char table pointers
630    
631    Returns:         nothing
632    */
633    
634    static void
635    set_nottype_bits(uschar *start_bits, int cbit_type, int table_limit,
636      compile_data *cd)
637    {
638    register int c;
639    for (c = 0; c < table_limit; c++) start_bits[c] |= ~cd->cbits[c+cbit_type];
640    if (table_limit != 32) for (c = 24; c < 32; c++) start_bits[c] = 0xff;
641  }  }
642    
643    
# Line 95  function fails unless the result is SSB_ Line 657  function fails unless the result is SSB_
657  Arguments:  Arguments:
658    code         points to an expression    code         points to an expression
659    start_bits   points to a 32-byte table, initialized to 0    start_bits   points to a 32-byte table, initialized to 0
   caseless     the current state of the caseless flag  
660    utf8         TRUE if in UTF-8 mode    utf8         TRUE if in UTF-8 mode
661    cd           the block with char table pointers    cd           the block with char table pointers
662    
663  Returns:       SSB_FAIL     => Failed to find any starting bytes  Returns:       SSB_FAIL     => Failed to find any starting bytes
664                 SSB_DONE     => Found mandatory starting bytes                 SSB_DONE     => Found mandatory starting bytes
665                 SSB_CONTINUE => Found optional starting bytes                 SSB_CONTINUE => Found optional starting bytes
666                   SSB_UNKNOWN  => Hit an unrecognized opcode
667  */  */
668    
669  static int  static int
670  set_start_bits(const uschar *code, uschar *start_bits, BOOL caseless,  set_start_bits(const uschar *code, uschar *start_bits, BOOL utf8,
671    BOOL utf8, compile_data *cd)    compile_data *cd)
672  {  {
673  register int c;  register int c;
674  int yield = SSB_DONE;  int yield = SSB_DONE;
675    int table_limit = utf8? 16:32;
676    
677  #if 0  #if 0
678  /* ========================================================================= */  /* ========================================================================= */
# Line 130  volatile int dummy; Line 693  volatile int dummy;
693    
694  do  do
695    {    {
   const uschar *tcode = code + (((int)*code == OP_CBRA)? 3:1) + LINK_SIZE;  
696    BOOL try_next = TRUE;    BOOL try_next = TRUE;
697      const uschar *tcode = code + 1 + LINK_SIZE;
698    
699      if (*code == OP_CBRA || *code == OP_SCBRA ||
700          *code == OP_CBRAPOS || *code == OP_SCBRAPOS) tcode += 2;
701    
702    while (try_next)    /* Loop for items in this branch */    while (try_next)    /* Loop for items in this branch */
703      {      {
704      int rc;      int rc;
705    
706      switch(*tcode)      switch(*tcode)
707        {        {
708        /* Fail if we reach something we don't understand */        /* If we reach something we don't understand, it means a new opcode has
709          been created that hasn't been added to this code. Hopefully this problem
710          will be discovered during testing. */
711    
712        default:        default:
713          return SSB_UNKNOWN;
714    
715          /* Fail for a valid opcode that implies no starting bits. */
716    
717          case OP_ACCEPT:
718          case OP_ASSERT_ACCEPT:
719          case OP_ALLANY:
720          case OP_ANY:
721          case OP_ANYBYTE:
722          case OP_CIRC:
723          case OP_CIRCM:
724          case OP_CLOSE:
725          case OP_COMMIT:
726          case OP_COND:
727          case OP_CREF:
728          case OP_DEF:
729          case OP_DOLL:
730          case OP_DOLLM:
731          case OP_END:
732          case OP_EOD:
733          case OP_EODN:
734          case OP_EXTUNI:
735          case OP_FAIL:
736          case OP_MARK:
737          case OP_NCREF:
738          case OP_NOT:
739          case OP_NOTEXACT:
740          case OP_NOTEXACTI:
741          case OP_NOTI:
742          case OP_NOTMINPLUS:
743          case OP_NOTMINPLUSI:
744          case OP_NOTMINQUERY:
745          case OP_NOTMINQUERYI:
746          case OP_NOTMINSTAR:
747          case OP_NOTMINSTARI:
748          case OP_NOTMINUPTO:
749          case OP_NOTMINUPTOI:
750          case OP_NOTPLUS:
751          case OP_NOTPLUSI:
752          case OP_NOTPOSPLUS:
753          case OP_NOTPOSPLUSI:
754          case OP_NOTPOSQUERY:
755          case OP_NOTPOSQUERYI:
756          case OP_NOTPOSSTAR:
757          case OP_NOTPOSSTARI:
758          case OP_NOTPOSUPTO:
759          case OP_NOTPOSUPTOI:
760          case OP_NOTPROP:
761          case OP_NOTQUERY:
762          case OP_NOTQUERYI:
763          case OP_NOTSTAR:
764          case OP_NOTSTARI:
765          case OP_NOTUPTO:
766          case OP_NOTUPTOI:
767          case OP_NOT_HSPACE:
768          case OP_NOT_VSPACE:
769          case OP_NRREF:
770          case OP_PROP:
771          case OP_PRUNE:
772          case OP_PRUNE_ARG:
773          case OP_RECURSE:
774          case OP_REF:
775          case OP_REFI:
776          case OP_REVERSE:
777          case OP_RREF:
778          case OP_SCOND:
779          case OP_SET_SOM:
780          case OP_SKIP:
781          case OP_SKIP_ARG:
782          case OP_SOD:
783          case OP_SOM:
784          case OP_THEN:
785          case OP_THEN_ARG:
786          case OP_XCLASS:
787        return SSB_FAIL;        return SSB_FAIL;
788    
789          /* We can ignore word boundary tests. */
790    
791          case OP_WORD_BOUNDARY:
792          case OP_NOT_WORD_BOUNDARY:
793          tcode++;
794          break;
795    
796        /* If we hit a bracket or a positive lookahead assertion, recurse to set        /* If we hit a bracket or a positive lookahead assertion, recurse to set
797        bits from within the subpattern. If it can't find anything, we have to        bits from within the subpattern. If it can't find anything, we have to
798        give up. If it finds some mandatory character(s), we are done for this        give up. If it finds some mandatory character(s), we are done for this
# Line 152  do Line 802  do
802        case OP_SBRA:        case OP_SBRA:
803        case OP_CBRA:        case OP_CBRA:
804        case OP_SCBRA:        case OP_SCBRA:
805          case OP_BRAPOS:
806          case OP_SBRAPOS:
807          case OP_CBRAPOS:
808          case OP_SCBRAPOS:
809        case OP_ONCE:        case OP_ONCE:
810          case OP_ONCE_NC:
811        case OP_ASSERT:        case OP_ASSERT:
812        rc = set_start_bits(tcode, start_bits, caseless, utf8, cd);        rc = set_start_bits(tcode, start_bits, utf8, cd);
813        if (rc == SSB_FAIL) return SSB_FAIL;        if (rc == SSB_FAIL || rc == SSB_UNKNOWN) return rc;
814        if (rc == SSB_DONE) try_next = FALSE; else        if (rc == SSB_DONE) try_next = FALSE; else
815          {          {
816          do tcode += GET(tcode, 1); while (*tcode == OP_ALT);          do tcode += GET(tcode, 1); while (*tcode == OP_ALT);
# Line 178  do Line 833  do
833        case OP_KET:        case OP_KET:
834        case OP_KETRMAX:        case OP_KETRMAX:
835        case OP_KETRMIN:        case OP_KETRMIN:
836          case OP_KETRPOS:
837        return SSB_CONTINUE;        return SSB_CONTINUE;
838    
839        /* Skip over callout */        /* Skip over callout */
# Line 195  do Line 851  do
851        tcode += 1 + LINK_SIZE;        tcode += 1 + LINK_SIZE;
852        break;        break;
853    
       /* Skip over an option setting, changing the caseless flag */  
   
       case OP_OPT:  
       caseless = (tcode[1] & PCRE_CASELESS) != 0;  
       tcode += 2;  
       break;  
   
854        /* BRAZERO does the bracket, but carries on. */        /* BRAZERO does the bracket, but carries on. */
855    
856        case OP_BRAZERO:        case OP_BRAZERO:
857        case OP_BRAMINZERO:        case OP_BRAMINZERO:
858        if (set_start_bits(++tcode, start_bits, caseless, utf8, cd) == SSB_FAIL)        case OP_BRAPOSZERO:
859          return SSB_FAIL;        rc = set_start_bits(++tcode, start_bits, utf8, cd);
860          if (rc == SSB_FAIL || rc == SSB_UNKNOWN) return rc;
861  /* =========================================================================  /* =========================================================================
862        See the comment at the head of this function concerning the next line,        See the comment at the head of this function concerning the next line,
863        which was an old fudge for the benefit of OS/2.        which was an old fudge for the benefit of OS/2.
# Line 217  do Line 867  do
867        tcode += 1 + LINK_SIZE;        tcode += 1 + LINK_SIZE;
868        break;        break;
869    
870          /* SKIPZERO skips the bracket. */
871    
872          case OP_SKIPZERO:
873          tcode++;
874          do tcode += GET(tcode,1); while (*tcode == OP_ALT);
875          tcode += 1 + LINK_SIZE;
876          break;
877    
878        /* Single-char * or ? sets the bit and tries the next item */        /* Single-char * or ? sets the bit and tries the next item */
879    
880        case OP_STAR:        case OP_STAR:
# Line 225  do Line 883  do
883        case OP_QUERY:        case OP_QUERY:
884        case OP_MINQUERY:        case OP_MINQUERY:
885        case OP_POSQUERY:        case OP_POSQUERY:
886        set_bit(start_bits, tcode[1], caseless, cd);        tcode = set_table_bit(start_bits, tcode + 1, FALSE, cd, utf8);
887        tcode += 2;        break;
888  #ifdef SUPPORT_UTF8  
889        if (utf8 && tcode[-1] >= 0xc0)        case OP_STARI:
890          tcode += _pcre_utf8_table4[tcode[-1] & 0x3f];        case OP_MINSTARI:
891  #endif        case OP_POSSTARI:
892          case OP_QUERYI:
893          case OP_MINQUERYI:
894          case OP_POSQUERYI:
895          tcode = set_table_bit(start_bits, tcode + 1, TRUE, cd, utf8);
896        break;        break;
897    
898        /* Single-char upto sets the bit and tries the next */        /* Single-char upto sets the bit and tries the next */
# Line 238  do Line 900  do
900        case OP_UPTO:        case OP_UPTO:
901        case OP_MINUPTO:        case OP_MINUPTO:
902        case OP_POSUPTO:        case OP_POSUPTO:
903        set_bit(start_bits, tcode[3], caseless, cd);        tcode = set_table_bit(start_bits, tcode + 3, FALSE, cd, utf8);
904        tcode += 4;        break;
905  #ifdef SUPPORT_UTF8  
906        if (utf8 && tcode[-1] >= 0xc0)        case OP_UPTOI:
907          tcode += _pcre_utf8_table4[tcode[-1] & 0x3f];        case OP_MINUPTOI:
908  #endif        case OP_POSUPTOI:
909          tcode = set_table_bit(start_bits, tcode + 3, TRUE, cd, utf8);
910        break;        break;
911    
912        /* At least one single char sets the bit and stops */        /* At least one single char sets the bit and stops */
913    
914        case OP_EXACT:       /* Fall through */        case OP_EXACT:
915        tcode += 2;        tcode += 2;
916          /* Fall through */
917        case OP_CHAR:        case OP_CHAR:
       case OP_CHARNC:  
918        case OP_PLUS:        case OP_PLUS:
919        case OP_MINPLUS:        case OP_MINPLUS:
920        case OP_POSPLUS:        case OP_POSPLUS:
921        set_bit(start_bits, tcode[1], caseless, cd);        (void)set_table_bit(start_bits, tcode + 1, FALSE, cd, utf8);
922          try_next = FALSE;
923          break;
924    
925          case OP_EXACTI:
926          tcode += 2;
927          /* Fall through */
928          case OP_CHARI:
929          case OP_PLUSI:
930          case OP_MINPLUSI:
931          case OP_POSPLUSI:
932          (void)set_table_bit(start_bits, tcode + 1, TRUE, cd, utf8);
933          try_next = FALSE;
934          break;
935    
936          /* Special spacing and line-terminating items. These recognize specific
937          lists of characters. The difference between VSPACE and ANYNL is that the
938          latter can match the two-character CRLF sequence, but that is not
939          relevant for finding the first character, so their code here is
940          identical. */
941    
942          case OP_HSPACE:
943          SET_BIT(0x09);
944          SET_BIT(0x20);
945          if (utf8)
946            {
947            SET_BIT(0xC2);  /* For U+00A0 */
948            SET_BIT(0xE1);  /* For U+1680, U+180E */
949            SET_BIT(0xE2);  /* For U+2000 - U+200A, U+202F, U+205F */
950            SET_BIT(0xE3);  /* For U+3000 */
951            }
952          else SET_BIT(0xA0);
953        try_next = FALSE;        try_next = FALSE;
954        break;        break;
955    
956        /* Single character type sets the bits and stops */        case OP_ANYNL:
957          case OP_VSPACE:
958          SET_BIT(0x0A);
959          SET_BIT(0x0B);
960          SET_BIT(0x0C);
961          SET_BIT(0x0D);
962          if (utf8)
963            {
964            SET_BIT(0xC2);  /* For U+0085 */
965            SET_BIT(0xE2);  /* For U+2028, U+2029 */
966            }
967          else SET_BIT(0x85);
968          try_next = FALSE;
969          break;
970    
971          /* Single character types set the bits and stop. Note that if PCRE_UCP
972          is set, we do not see these op codes because \d etc are converted to
973          properties. Therefore, these apply in the case when only characters less
974          than 256 are recognized to match the types. */
975    
976        case OP_NOT_DIGIT:        case OP_NOT_DIGIT:
977        for (c = 0; c < 32; c++)        set_nottype_bits(start_bits, cbit_digit, table_limit, cd);
         start_bits[c] |= ~cd->cbits[c+cbit_digit];  
978        try_next = FALSE;        try_next = FALSE;
979        break;        break;
980    
981        case OP_DIGIT:        case OP_DIGIT:
982        for (c = 0; c < 32; c++)        set_type_bits(start_bits, cbit_digit, table_limit, cd);
         start_bits[c] |= cd->cbits[c+cbit_digit];  
983        try_next = FALSE;        try_next = FALSE;
984        break;        break;
985    
986        /* The cbit_space table has vertical tab as whitespace; we have to        /* The cbit_space table has vertical tab as whitespace; we have to
987        discard it. */        ensure it is set as not whitespace. */
988    
989        case OP_NOT_WHITESPACE:        case OP_NOT_WHITESPACE:
990        for (c = 0; c < 32; c++)        set_nottype_bits(start_bits, cbit_space, table_limit, cd);
991          {        start_bits[1] |= 0x08;
         int d = cd->cbits[c+cbit_space];  
         if (c == 1) d &= ~0x08;  
         start_bits[c] |= ~d;  
         }  
992        try_next = FALSE;        try_next = FALSE;
993        break;        break;
994    
995        /* The cbit_space table has vertical tab as whitespace; we have to        /* The cbit_space table has vertical tab as whitespace; we have to
996        discard it. */        not set it from the table. */
997    
998        case OP_WHITESPACE:        case OP_WHITESPACE:
999        for (c = 0; c < 32; c++)        c = start_bits[1];    /* Save in case it was already set */
1000          {        set_type_bits(start_bits, cbit_space, table_limit, cd);
1001          int d = cd->cbits[c+cbit_space];        start_bits[1] = (start_bits[1] & ~0x08) | c;
         if (c == 1) d &= ~0x08;  
         start_bits[c] |= d;  
         }  
1002        try_next = FALSE;        try_next = FALSE;
1003        break;        break;
1004    
1005        case OP_NOT_WORDCHAR:        case OP_NOT_WORDCHAR:
1006        for (c = 0; c < 32; c++)        set_nottype_bits(start_bits, cbit_word, table_limit, cd);
         start_bits[c] |= ~cd->cbits[c+cbit_word];  
1007        try_next = FALSE;        try_next = FALSE;
1008        break;        break;
1009    
1010        case OP_WORDCHAR:        case OP_WORDCHAR:
1011        for (c = 0; c < 32; c++)        set_type_bits(start_bits, cbit_word, table_limit, cd);
         start_bits[c] |= cd->cbits[c+cbit_word];  
1012        try_next = FALSE;        try_next = FALSE;
1013        break;        break;
1014    
# Line 317  do Line 1017  do
1017    
1018        case OP_TYPEPLUS:        case OP_TYPEPLUS:
1019        case OP_TYPEMINPLUS:        case OP_TYPEMINPLUS:
1020          case OP_TYPEPOSPLUS:
1021        tcode++;        tcode++;
1022        break;        break;
1023    
# Line 340  do Line 1041  do
1041        case OP_TYPEPOSQUERY:        case OP_TYPEPOSQUERY:
1042        switch(tcode[1])        switch(tcode[1])
1043          {          {
1044            default:
1045          case OP_ANY:          case OP_ANY:
1046            case OP_ALLANY:
1047          return SSB_FAIL;          return SSB_FAIL;
1048    
1049            case OP_HSPACE:
1050            SET_BIT(0x09);
1051            SET_BIT(0x20);
1052            if (utf8)
1053              {
1054              SET_BIT(0xC2);  /* For U+00A0 */
1055              SET_BIT(0xE1);  /* For U+1680, U+180E */
1056              SET_BIT(0xE2);  /* For U+2000 - U+200A, U+202F, U+205F */
1057              SET_BIT(0xE3);  /* For U+3000 */
1058              }
1059            else SET_BIT(0xA0);
1060            break;
1061    
1062            case OP_ANYNL:
1063            case OP_VSPACE:
1064            SET_BIT(0x0A);
1065            SET_BIT(0x0B);
1066            SET_BIT(0x0C);
1067            SET_BIT(0x0D);
1068            if (utf8)
1069              {
1070              SET_BIT(0xC2);  /* For U+0085 */
1071              SET_BIT(0xE2);  /* For U+2028, U+2029 */
1072              }
1073            else SET_BIT(0x85);
1074            break;
1075    
1076          case OP_NOT_DIGIT:          case OP_NOT_DIGIT:
1077          for (c = 0; c < 32; c++)          set_nottype_bits(start_bits, cbit_digit, table_limit, cd);
           start_bits[c] |= ~cd->cbits[c+cbit_digit];  
1078          break;          break;
1079    
1080          case OP_DIGIT:          case OP_DIGIT:
1081          for (c = 0; c < 32; c++)          set_type_bits(start_bits, cbit_digit, table_limit, cd);
           start_bits[c] |= cd->cbits[c+cbit_digit];  
1082          break;          break;
1083    
1084          /* The cbit_space table has vertical tab as whitespace; we have to          /* The cbit_space table has vertical tab as whitespace; we have to
1085          discard it. */          ensure it gets set as not whitespace. */
1086    
1087          case OP_NOT_WHITESPACE:          case OP_NOT_WHITESPACE:
1088          for (c = 0; c < 32; c++)          set_nottype_bits(start_bits, cbit_space, table_limit, cd);
1089            {          start_bits[1] |= 0x08;
           int d = cd->cbits[c+cbit_space];  
           if (c == 1) d &= ~0x08;  
           start_bits[c] |= ~d;  
           }  
1090          break;          break;
1091    
1092          /* The cbit_space table has vertical tab as whitespace; we have to          /* The cbit_space table has vertical tab as whitespace; we have to
1093          discard it. */          avoid setting it. */
1094    
1095          case OP_WHITESPACE:          case OP_WHITESPACE:
1096          for (c = 0; c < 32; c++)          c = start_bits[1];    /* Save in case it was already set */
1097            {          set_type_bits(start_bits, cbit_space, table_limit, cd);
1098            int d = cd->cbits[c+cbit_space];          start_bits[1] = (start_bits[1] & ~0x08) | c;
           if (c == 1) d &= ~0x08;  
           start_bits[c] |= d;  
           }  
1099          break;          break;
1100    
1101          case OP_NOT_WORDCHAR:          case OP_NOT_WORDCHAR:
1102          for (c = 0; c < 32; c++)          set_nottype_bits(start_bits, cbit_word, table_limit, cd);
           start_bits[c] |= ~cd->cbits[c+cbit_word];  
1103          break;          break;
1104    
1105          case OP_WORDCHAR:          case OP_WORDCHAR:
1106          for (c = 0; c < 32; c++)          set_type_bits(start_bits, cbit_word, table_limit, cd);
           start_bits[c] |= cd->cbits[c+cbit_word];  
1107          break;          break;
1108          }          }
1109    
# Line 440  do Line 1159  do
1159            for (c = 0; c < 32; c++) start_bits[c] |= tcode[c];            for (c = 0; c < 32; c++) start_bits[c] |= tcode[c];
1160            }            }
1161    
1162          /* Advance past the bit map, and act on what follows */          /* Advance past the bit map, and act on what follows. For a zero
1163            minimum repeat, continue; otherwise stop processing. */
1164    
1165          tcode += 32;          tcode += 32;
1166          switch (*tcode)          switch (*tcode)
# Line 476  return yield; Line 1196  return yield;
1196    
1197    
1198    
1199    
1200    
1201  /*************************************************  /*************************************************
1202  *          Study a compiled expression           *  *          Study a compiled expression           *
1203  *************************************************/  *************************************************/
# Line 491  Arguments: Line 1213  Arguments:
1213              set NULL unless error              set NULL unless error
1214    
1215  Returns:    pointer to a pcre_extra block, with study_data filled in and the  Returns:    pointer to a pcre_extra block, with study_data filled in and the
1216                appropriate flag set;                appropriate flags set;
1217              NULL on error or if no optimization possible              NULL on error or if no optimization possible
1218  */  */
1219    
1220  PCRE_EXP_DEFN pcre_extra *  PCRE_EXP_DEFN pcre_extra * PCRE_CALL_CONVENTION
1221  pcre_study(const pcre *external_re, int options, const char **errorptr)  pcre_study(const pcre *external_re, int options, const char **errorptr)
1222  {  {
1223    int min;
1224    BOOL bits_set = FALSE;
1225  uschar start_bits[32];  uschar start_bits[32];
1226  pcre_extra *extra;  pcre_extra *extra = NULL;
1227  pcre_study_data *study;  pcre_study_data *study;
1228  const uschar *tables;  const uschar *tables;
1229  uschar *code;  uschar *code;
# Line 524  code = (uschar *)re + re->name_table_off Line 1248  code = (uschar *)re + re->name_table_off
1248    (re->name_count * re->name_entry_size);    (re->name_count * re->name_entry_size);
1249    
1250  /* For an anchored pattern, or an unanchored pattern that has a first char, or  /* For an anchored pattern, or an unanchored pattern that has a first char, or
1251  a multiline pattern that matches only at "line starts", no further processing  a multiline pattern that matches only at "line starts", there is no point in
1252  at present. */  seeking a list of starting bytes. */
1253    
1254  if ((re->options & PCRE_ANCHORED) != 0 ||  if ((re->options & PCRE_ANCHORED) == 0 &&
1255      (re->flags & (PCRE_FIRSTSET|PCRE_STARTLINE)) != 0)      (re->flags & (PCRE_FIRSTSET|PCRE_STARTLINE)) == 0)
1256    return NULL;    {
1257      int rc;
1258    
1259  /* Set the character tables in the block that is passed around */    /* Set the character tables in the block that is passed around */
1260    
1261  tables = re->tables;    tables = re->tables;
1262  if (tables == NULL)    if (tables == NULL)
1263    (void)pcre_fullinfo(external_re, NULL, PCRE_INFO_DEFAULT_TABLES,      (void)pcre_fullinfo(external_re, NULL, PCRE_INFO_DEFAULT_TABLES,
1264    (void *)(&tables));      (void *)(&tables));
1265    
1266  compile_block.lcc = tables + lcc_offset;    compile_block.lcc = tables + lcc_offset;
1267  compile_block.fcc = tables + fcc_offset;    compile_block.fcc = tables + fcc_offset;
1268  compile_block.cbits = tables + cbits_offset;    compile_block.cbits = tables + cbits_offset;
1269  compile_block.ctypes = tables + ctypes_offset;    compile_block.ctypes = tables + ctypes_offset;
1270    
1271  /* See if we can find a fixed set of initial characters for the pattern. */    /* See if we can find a fixed set of initial characters for the pattern. */
1272    
1273  memset(start_bits, 0, 32 * sizeof(uschar));    memset(start_bits, 0, 32 * sizeof(uschar));
1274  if (set_start_bits(code, start_bits, (re->options & PCRE_CASELESS) != 0,    rc = set_start_bits(code, start_bits, (re->options & PCRE_UTF8) != 0,
1275    (re->options & PCRE_UTF8) != 0, &compile_block) != SSB_DONE) return NULL;      &compile_block);
1276      bits_set = rc == SSB_DONE;
1277  /* Get a pcre_extra block and a pcre_study_data block. The study data is put in    if (rc == SSB_UNKNOWN)
1278  the latter, which is pointed to by the former, which may also get additional      {
1279  data set later by the calling program. At the moment, the size of      *errorptr = "internal error: opcode not recognized";
1280  pcre_study_data is fixed. We nevertheless save it in a field for returning via      return NULL;
1281  the pcre_fullinfo() function so that if it becomes variable in the future, we      }
1282  don't have to change that code. */    }
1283    
1284  extra = (pcre_extra *)(pcre_malloc)  /* Find the minimum length of subject string. */
   (sizeof(pcre_extra) + sizeof(pcre_study_data));  
1285    
1286  if (extra == NULL)  switch(min = find_minlength(code, code, re->options, 0))
1287    {    {
1288    *errorptr = "failed to get memory";    case -2: *errorptr = "internal error: missing capturing bracket"; return NULL;
1289    return NULL;    case -3: *errorptr = "internal error: opcode not recognized"; return NULL;
1290      default: break;
1291    }    }
1292    
1293  study = (pcre_study_data *)((char *)extra + sizeof(pcre_extra));  /* If a set of starting bytes has been identified, or if the minimum length is
1294  extra->flags = PCRE_EXTRA_STUDY_DATA;  greater than zero, or if JIT optimization has been requested, get a pcre_extra
1295  extra->study_data = study;  block and a pcre_study_data block. The study data is put in the latter, which
1296    is pointed to by the former, which may also get additional data set later by
1297  study->size = sizeof(pcre_study_data);  the calling program. At the moment, the size of pcre_study_data is fixed. We
1298  study->options = PCRE_STUDY_MAPPED;  nevertheless save it in a field for returning via the pcre_fullinfo() function
1299  memcpy(study->start_bits, start_bits, sizeof(start_bits));  so that if it becomes variable in the future, we don't have to change that
1300    code. */
1301    
1302    if (bits_set || min > 0
1303    #ifdef SUPPORT_JIT
1304        || (options & PCRE_STUDY_JIT_COMPILE) != 0
1305    #endif
1306      )
1307      {
1308      extra = (pcre_extra *)(pcre_malloc)
1309        (sizeof(pcre_extra) + sizeof(pcre_study_data));
1310      if (extra == NULL)
1311        {
1312        *errorptr = "failed to get memory";
1313        return NULL;
1314        }
1315    
1316      study = (pcre_study_data *)((char *)extra + sizeof(pcre_extra));
1317      extra->flags = PCRE_EXTRA_STUDY_DATA;
1318      extra->study_data = study;
1319    
1320      study->size = sizeof(pcre_study_data);
1321      study->flags = 0;
1322    
1323      if (bits_set)
1324        {
1325        study->flags |= PCRE_STUDY_MAPPED;
1326        memcpy(study->start_bits, start_bits, sizeof(start_bits));
1327        }
1328    
1329      /* Always set the minlength value in the block, because the JIT compiler
1330      makes use of it. However, don't set the bit unless the length is greater than
1331      zero - the interpretive pcre_exec() and pcre_dfa_exec() needn't waste time
1332      checking the zero case. */
1333    
1334      if (min > 0)
1335        {
1336        study->flags |= PCRE_STUDY_MINLEN;
1337        study->minlength = min;
1338        }
1339      else study->minlength = 0;
1340    
1341      /* If JIT support was compiled and requested, attempt the JIT compilation.
1342      If no starting bytes were found, and the minimum length is zero, and JIT
1343      compilation fails, abandon the extra block and return NULL. */
1344    
1345    #ifdef SUPPORT_JIT
1346      extra->executable_jit = NULL;
1347      if ((options & PCRE_STUDY_JIT_COMPILE) != 0) _pcre_jit_compile(re, extra);
1348      if (study->flags == 0 && (extra->flags & PCRE_EXTRA_EXECUTABLE_JIT) == 0)
1349        {
1350        pcre_free_study(extra);
1351        extra = NULL;
1352        }
1353    #endif
1354      }
1355    
1356  return extra;  return extra;
1357  }  }
1358    
1359    
1360    /*************************************************
1361    *          Free the study data                   *
1362    *************************************************/
1363    
1364    /* This function frees the memory that was obtained by pcre_study().
1365    
1366    Argument:   a pointer to the pcre_extra block
1367    Returns:    nothing
1368    */
1369    
1370    PCRE_EXP_DEFN void
1371    pcre_free_study(pcre_extra *extra)
1372    {
1373    #ifdef SUPPORT_JIT
1374    if ((extra->flags & PCRE_EXTRA_EXECUTABLE_JIT) != 0 &&
1375         extra->executable_jit != NULL)
1376      _pcre_jit_free(extra->executable_jit);
1377    #endif
1378    pcre_free(extra);
1379    }
1380    
1381  /* End of pcre_study.c */  /* End of pcre_study.c */

Legend:
Removed from v.230  
changed lines
  Added in v.730

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12