/[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 603 by ph10, Fri May 27 10:14:09 2011 UTC revision 797 by ph10, Sun Dec 11 17:09:37 2011 UTC
# Line 52  supporting functions. */ Line 52  supporting functions. */
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    
# Line 66  string of that length that matches. In U Line 66  string of that length that matches. In U
66  rather than bytes.  rather than bytes.
67    
68  Arguments:  Arguments:
69    code       pointer to start of group (the bracket)    code            pointer to start of group (the bracket)
70    startcode  pointer to start of the whole pattern    startcode       pointer to start of the whole pattern
71    options    the compiling options    options         the compiling options
72      int             RECURSE depth
73    
74  Returns:   the minimum length  Returns:   the minimum length
75             -1 if \C was encountered             -1 if \C in UTF-8 mode or (*ACCEPT) was encountered
76             -2 internal error (missing capturing bracket)             -2 internal error (missing capturing bracket)
77             -3 internal error (opcode not listed)             -3 internal error (opcode not listed)
78  */  */
79    
80  static int  static int
81  find_minlength(const uschar *code, const uschar *startcode, int options)  find_minlength(const uschar *code, const uschar *startcode, int options,
82      int recurse_depth)
83  {  {
84  int length = -1;  int length = -1;
85  BOOL utf8 = (options & PCRE_UTF8) != 0;  BOOL utf8 = (options & PCRE_UTF8) != 0;
# Line 85  BOOL had_recurse = FALSE; Line 87  BOOL had_recurse = FALSE;
87  register int branchlength = 0;  register int branchlength = 0;
88  register uschar *cc = (uschar *)code + 1 + LINK_SIZE;  register uschar *cc = (uschar *)code + 1 + LINK_SIZE;
89    
90  if (*code == OP_CBRA || *code == OP_SCBRA) cc += 2;  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  /* 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. */  branch, check the length against that of the other branches. */
# Line 119  for (;;) Line 122  for (;;)
122      case OP_SCBRA:      case OP_SCBRA:
123      case OP_BRA:      case OP_BRA:
124      case OP_SBRA:      case OP_SBRA:
125        case OP_CBRAPOS:
126        case OP_SCBRAPOS:
127        case OP_BRAPOS:
128        case OP_SBRAPOS:
129      case OP_ONCE:      case OP_ONCE:
130      d = find_minlength(cc, startcode, options);      case OP_ONCE_NC:
131        d = find_minlength(cc, startcode, options, recurse_depth);
132      if (d < 0) return d;      if (d < 0) return d;
133      branchlength += d;      branchlength += d;
134      do cc += GET(cc, 1); while (*cc == OP_ALT);      do cc += GET(cc, 1); while (*cc == OP_ALT);
135      cc += 1 + LINK_SIZE;      cc += 1 + LINK_SIZE;
136      break;      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      /* 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      call. If it's ALT it is an alternation in a nested call. If it is END it's
146      END it's the end of the outer call. All can be handled by the same code. */      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:      case OP_ALT:
151      case OP_KET:      case OP_KET:
152      case OP_KETRMAX:      case OP_KETRMAX:
153      case OP_KETRMIN:      case OP_KETRMIN:
154        case OP_KETRPOS:
155      case OP_END:      case OP_END:
156      if (length < 0 || (!had_recurse && branchlength < length))      if (length < 0 || (!had_recurse && branchlength < length))
157        length = branchlength;        length = branchlength;
158      if (*cc != OP_ALT) return length;      if (op != OP_ALT) return length;
159      cc += 1 + LINK_SIZE;      cc += 1 + LINK_SIZE;
160      branchlength = 0;      branchlength = 0;
161      had_recurse = FALSE;      had_recurse = FALSE;
# Line 179  for (;;) Line 196  for (;;)
196    
197      case OP_BRAZERO:      case OP_BRAZERO:
198      case OP_BRAMINZERO:      case OP_BRAMINZERO:
199        case OP_BRAPOSZERO:
200      case OP_SKIPZERO:      case OP_SKIPZERO:
201      cc += _pcre_OP_lengths[*cc];      cc += _pcre_OP_lengths[*cc];
202      do cc += GET(cc, 1); while (*cc == OP_ALT);      do cc += GET(cc, 1); while (*cc == OP_ALT);
# Line 260  for (;;) Line 278  for (;;)
278      cc++;      cc++;
279      break;      break;
280    
281      /* "Any newline" might match two characters */      /* "Any newline" might match two characters, but it also might match just
282        one. */
283    
284      case OP_ANYNL:      case OP_ANYNL:
285      branchlength += 2;      branchlength += 1;
286      cc++;      cc++;
287      break;      break;
288    
289      /* The single-byte matcher means we can't proceed in UTF-8 mode */      /* The single-byte matcher means we can't proceed in UTF-8 mode. (In
290        non-UTF-8 mode \C will actually be turned into OP_ALLANY, so won't ever
291        appear, but leave the code, just in case.) */
292    
293      case OP_ANYBYTE:      case OP_ANYBYTE:
294  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
# Line 359  for (;;) Line 380  for (;;)
380          d = 0;          d = 0;
381          had_recurse = TRUE;          had_recurse = TRUE;
382          }          }
383        else d = find_minlength(cs, startcode, options);        else
384            {
385            d = find_minlength(cs, startcode, options, recurse_depth);
386            }
387        }        }
388      else d = 0;      else d = 0;
389      cc += 3;      cc += 3;
# Line 376  for (;;) Line 400  for (;;)
400        cc++;        cc++;
401        break;        break;
402    
403          case OP_CRPLUS:
404          case OP_CRMINPLUS:
405          min = 1;
406          cc++;
407          break;
408    
409        case OP_CRRANGE:        case OP_CRRANGE:
410        case OP_CRMINRANGE:        case OP_CRMINRANGE:
411        min = GET2(cc, 1);        min = GET2(cc, 1);
# Line 390  for (;;) Line 420  for (;;)
420      branchlength += min * d;      branchlength += min * d;
421      break;      break;
422    
423        /* We can easily detect direct recursion, but not mutual recursion. This is
424        caught by a recursion depth count. */
425    
426      case OP_RECURSE:      case OP_RECURSE:
427      cs = ce = (uschar *)startcode + GET(cc, 1);      cs = ce = (uschar *)startcode + GET(cc, 1);
     if (cs == NULL) return -2;  
428      do ce += GET(ce, 1); while (*ce == OP_ALT);      do ce += GET(ce, 1); while (*ce == OP_ALT);
429      if (cc > cs && cc < ce)      if ((cc > cs && cc < ce) || recurse_depth > 10)
430        had_recurse = TRUE;        had_recurse = TRUE;
431      else      else
432        branchlength += find_minlength(cs, startcode, options);        {
433          branchlength += find_minlength(cs, startcode, options, recurse_depth + 1);
434          }
435      cc += 1 + LINK_SIZE;      cc += 1 + LINK_SIZE;
436      break;      break;
437    
# Line 406  for (;;) Line 440  for (;;)
440      of a character, we must take special action for UTF-8 characters. As it      of a character, we must take special action for UTF-8 characters. As it
441      happens, the "NOT" versions of these opcodes are used at present only for      happens, the "NOT" versions of these opcodes are used at present only for
442      ASCII characters, so they could be omitted from this list. However, in      ASCII characters, so they could be omitted from this list. However, in
443      future that may change, so we include them here so as not to leave a      future that may change, so we include them here so as not to leave a
444      gotcha for a future maintainer. */      gotcha for a future maintainer. */
445    
446      case OP_UPTO:      case OP_UPTO:
# Line 459  for (;;) Line 493  for (;;)
493      case OP_MARK:      case OP_MARK:
494      case OP_PRUNE_ARG:      case OP_PRUNE_ARG:
495      case OP_SKIP_ARG:      case OP_SKIP_ARG:
     cc += _pcre_OP_lengths[op] + cc[1];  
     break;  
   
496      case OP_THEN_ARG:      case OP_THEN_ARG:
497      cc += _pcre_OP_lengths[op] + cc[1+LINK_SIZE];      cc += _pcre_OP_lengths[op] + cc[1];
498      break;      break;
499    
500      /* The remaining opcodes are just skipped over. */      /* The remaining opcodes are just skipped over. */
501    
     case OP_ACCEPT:  
502      case OP_CLOSE:      case OP_CLOSE:
503      case OP_COMMIT:      case OP_COMMIT:
504      case OP_FAIL:      case OP_FAIL:
505      case OP_PRUNE:      case OP_PRUNE:
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 += _pcre_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
513      new ones get added they are properly considered. */      new ones get added they are properly considered. */
514    
# Line 635  Arguments: Line 665  Arguments:
665  Returns:       SSB_FAIL     => Failed to find any starting bytes  Returns:       SSB_FAIL     => Failed to find any starting bytes
666                 SSB_DONE     => Found mandatory starting bytes                 SSB_DONE     => Found mandatory starting bytes
667                 SSB_CONTINUE => Found optional starting bytes                 SSB_CONTINUE => Found optional starting bytes
668                   SSB_UNKNOWN  => Hit an unrecognized opcode
669  */  */
670    
671  static int  static int
672  set_start_bits(const uschar *code, uschar *start_bits, BOOL utf8,  set_start_bits(const uschar *code, uschar *start_bits, BOOL utf8,
673    compile_data *cd)    compile_data *cd)
674  {  {
675  register int c;  register int c;
# Line 664  volatile int dummy; Line 695  volatile int dummy;
695    
696  do  do
697    {    {
   const uschar *tcode = code + (((int)*code == OP_CBRA)? 3:1) + LINK_SIZE;  
698    BOOL try_next = TRUE;    BOOL try_next = TRUE;
699      const uschar *tcode = code + 1 + LINK_SIZE;
700    
701      if (*code == OP_CBRA || *code == OP_SCBRA ||
702          *code == OP_CBRAPOS || *code == OP_SCBRAPOS) tcode += 2;
703    
704    while (try_next)    /* Loop for items in this branch */    while (try_next)    /* Loop for items in this branch */
705      {      {
706      int rc;      int rc;
707    
708      switch(*tcode)      switch(*tcode)
709        {        {
710        /* Fail if we reach something we don't understand */        /* If we reach something we don't understand, it means a new opcode has
711          been created that hasn't been added to this code. Hopefully this problem
712          will be discovered during testing. */
713    
714        default:        default:
715          return SSB_UNKNOWN;
716    
717          /* Fail for a valid opcode that implies no starting bits. */
718    
719          case OP_ACCEPT:
720          case OP_ASSERT_ACCEPT:
721          case OP_ALLANY:
722          case OP_ANY:
723          case OP_ANYBYTE:
724          case OP_CIRC:
725          case OP_CIRCM:
726          case OP_CLOSE:
727          case OP_COMMIT:
728          case OP_COND:
729          case OP_CREF:
730          case OP_DEF:
731          case OP_DOLL:
732          case OP_DOLLM:
733          case OP_END:
734          case OP_EOD:
735          case OP_EODN:
736          case OP_EXTUNI:
737          case OP_FAIL:
738          case OP_MARK:
739          case OP_NCREF:
740          case OP_NOT:
741          case OP_NOTEXACT:
742          case OP_NOTEXACTI:
743          case OP_NOTI:
744          case OP_NOTMINPLUS:
745          case OP_NOTMINPLUSI:
746          case OP_NOTMINQUERY:
747          case OP_NOTMINQUERYI:
748          case OP_NOTMINSTAR:
749          case OP_NOTMINSTARI:
750          case OP_NOTMINUPTO:
751          case OP_NOTMINUPTOI:
752          case OP_NOTPLUS:
753          case OP_NOTPLUSI:
754          case OP_NOTPOSPLUS:
755          case OP_NOTPOSPLUSI:
756          case OP_NOTPOSQUERY:
757          case OP_NOTPOSQUERYI:
758          case OP_NOTPOSSTAR:
759          case OP_NOTPOSSTARI:
760          case OP_NOTPOSUPTO:
761          case OP_NOTPOSUPTOI:
762          case OP_NOTPROP:
763          case OP_NOTQUERY:
764          case OP_NOTQUERYI:
765          case OP_NOTSTAR:
766          case OP_NOTSTARI:
767          case OP_NOTUPTO:
768          case OP_NOTUPTOI:
769          case OP_NOT_HSPACE:
770          case OP_NOT_VSPACE:
771          case OP_NRREF:
772          case OP_PROP:
773          case OP_PRUNE:
774          case OP_PRUNE_ARG:
775          case OP_RECURSE:
776          case OP_REF:
777          case OP_REFI:
778          case OP_REVERSE:
779          case OP_RREF:
780          case OP_SCOND:
781          case OP_SET_SOM:
782          case OP_SKIP:
783          case OP_SKIP_ARG:
784          case OP_SOD:
785          case OP_SOM:
786          case OP_THEN:
787          case OP_THEN_ARG:
788          case OP_XCLASS:
789        return SSB_FAIL;        return SSB_FAIL;
790    
791          /* We can ignore word boundary tests. */
792    
793          case OP_WORD_BOUNDARY:
794          case OP_NOT_WORD_BOUNDARY:
795          tcode++;
796          break;
797    
798        /* 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
799        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
800        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 686  do Line 804  do
804        case OP_SBRA:        case OP_SBRA:
805        case OP_CBRA:        case OP_CBRA:
806        case OP_SCBRA:        case OP_SCBRA:
807          case OP_BRAPOS:
808          case OP_SBRAPOS:
809          case OP_CBRAPOS:
810          case OP_SCBRAPOS:
811        case OP_ONCE:        case OP_ONCE:
812          case OP_ONCE_NC:
813        case OP_ASSERT:        case OP_ASSERT:
814        rc = set_start_bits(tcode, start_bits, utf8, cd);        rc = set_start_bits(tcode, start_bits, utf8, cd);
815        if (rc == SSB_FAIL) return SSB_FAIL;        if (rc == SSB_FAIL || rc == SSB_UNKNOWN) return rc;
816        if (rc == SSB_DONE) try_next = FALSE; else        if (rc == SSB_DONE) try_next = FALSE; else
817          {          {
818          do tcode += GET(tcode, 1); while (*tcode == OP_ALT);          do tcode += GET(tcode, 1); while (*tcode == OP_ALT);
# Line 712  do Line 835  do
835        case OP_KET:        case OP_KET:
836        case OP_KETRMAX:        case OP_KETRMAX:
837        case OP_KETRMIN:        case OP_KETRMIN:
838          case OP_KETRPOS:
839        return SSB_CONTINUE;        return SSB_CONTINUE;
840    
841        /* Skip over callout */        /* Skip over callout */
# Line 733  do Line 857  do
857    
858        case OP_BRAZERO:        case OP_BRAZERO:
859        case OP_BRAMINZERO:        case OP_BRAMINZERO:
860        if (set_start_bits(++tcode, start_bits, utf8, cd) == SSB_FAIL)        case OP_BRAPOSZERO:
861          return SSB_FAIL;        rc = set_start_bits(++tcode, start_bits, utf8, cd);
862          if (rc == SSB_FAIL || rc == SSB_UNKNOWN) return rc;
863  /* =========================================================================  /* =========================================================================
864        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,
865        which was an old fudge for the benefit of OS/2.        which was an old fudge for the benefit of OS/2.
# Line 1036  do Line 1161  do
1161            for (c = 0; c < 32; c++) start_bits[c] |= tcode[c];            for (c = 0; c < 32; c++) start_bits[c] |= tcode[c];
1162            }            }
1163    
1164          /* Advance past the bit map, and act on what follows */          /* Advance past the bit map, and act on what follows. For a zero
1165            minimum repeat, continue; otherwise stop processing. */
1166    
1167          tcode += 32;          tcode += 32;
1168          switch (*tcode)          switch (*tcode)
# Line 1072  return yield; Line 1198  return yield;
1198    
1199    
1200    
1201    
1202    
1203  /*************************************************  /*************************************************
1204  *          Study a compiled expression           *  *          Study a compiled expression           *
1205  *************************************************/  *************************************************/
# Line 1097  pcre_study(const pcre *external_re, int Line 1225  pcre_study(const pcre *external_re, int
1225  int min;  int min;
1226  BOOL bits_set = FALSE;  BOOL bits_set = FALSE;
1227  uschar start_bits[32];  uschar start_bits[32];
1228  pcre_extra *extra;  pcre_extra *extra = NULL;
1229  pcre_study_data *study;  pcre_study_data *study;
1230  const uschar *tables;  const uschar *tables;
1231  uschar *code;  uschar *code;
# Line 1128  seeking a list of starting bytes. */ Line 1256  seeking a list of starting bytes. */
1256  if ((re->options & PCRE_ANCHORED) == 0 &&  if ((re->options & PCRE_ANCHORED) == 0 &&
1257      (re->flags & (PCRE_FIRSTSET|PCRE_STARTLINE)) == 0)      (re->flags & (PCRE_FIRSTSET|PCRE_STARTLINE)) == 0)
1258    {    {
1259      int rc;
1260    
1261    /* Set the character tables in the block that is passed around */    /* Set the character tables in the block that is passed around */
1262    
1263    tables = re->tables;    tables = re->tables;
# Line 1143  if ((re->options & PCRE_ANCHORED) == 0 & Line 1273  if ((re->options & PCRE_ANCHORED) == 0 &
1273    /* 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. */
1274    
1275    memset(start_bits, 0, 32 * sizeof(uschar));    memset(start_bits, 0, 32 * sizeof(uschar));
1276    bits_set = set_start_bits(code, start_bits, (re->options & PCRE_UTF8) != 0,    rc = set_start_bits(code, start_bits, (re->options & PCRE_UTF8) != 0,
1277      &compile_block) == SSB_DONE;      &compile_block);
1278      bits_set = rc == SSB_DONE;
1279      if (rc == SSB_UNKNOWN)
1280        {
1281        *errorptr = "internal error: opcode not recognized";
1282        return NULL;
1283        }
1284    }    }
1285    
1286  /* Find the minimum length of subject string. */  /* Find the minimum length of subject string. */
1287    
1288  switch(min = find_minlength(code, code, re->options))  switch(min = find_minlength(code, code, re->options, 0))
1289    {    {
1290    case -2: *errorptr = "internal error: missing capturing bracket"; break;    case -2: *errorptr = "internal error: missing capturing bracket"; return NULL;
1291    case -3: *errorptr = "internal error: opcode not recognized"; break;    case -3: *errorptr = "internal error: opcode not recognized"; return NULL;
1292    default: break;    default: break;
1293    }    }
1294    
1295    /* If a set of starting bytes has been identified, or if the minimum length is
1296    greater than zero, or if JIT optimization has been requested, get a pcre_extra
1297    block and a pcre_study_data block. The study data is put in the latter, which
1298    is pointed to by the former, which may also get additional data set later by
1299    the calling program. At the moment, the size of pcre_study_data is fixed. We
1300    nevertheless save it in a field for returning via the pcre_fullinfo() function
1301    so that if it becomes variable in the future, we don't have to change that
1302    code. */
1303    
1304    if (bits_set || min > 0
1305    #ifdef SUPPORT_JIT
1306        || (options & PCRE_STUDY_JIT_COMPILE) != 0
1307    #endif
1308      )
1309      {
1310      extra = (pcre_extra *)(pcre_malloc)
1311        (sizeof(pcre_extra) + sizeof(pcre_study_data));
1312      if (extra == NULL)
1313        {
1314        *errorptr = "failed to get memory";
1315        return NULL;
1316        }
1317    
1318  /* Return NULL if no optimization is possible. */    study = (pcre_study_data *)((char *)extra + sizeof(pcre_extra));
1319      extra->flags = PCRE_EXTRA_STUDY_DATA;
1320      extra->study_data = study;
1321    
1322      study->size = sizeof(pcre_study_data);
1323      study->flags = 0;
1324    
1325      /* Set the start bits always, to avoid unset memory errors if the
1326      study data is written to a file, but set the flag only if any of the bits
1327      are set, to save time looking when none are. */
1328    
1329  if (!bits_set && min < 0) return NULL;    if (bits_set)
1330        {
1331        study->flags |= PCRE_STUDY_MAPPED;
1332        memcpy(study->start_bits, start_bits, sizeof(start_bits));
1333        }
1334      else memset(study->start_bits, 0, 32 * sizeof(uschar));
1335    
1336  /* Get a pcre_extra block and a pcre_study_data block. The study data is put in    /* Always set the minlength value in the block, because the JIT compiler
1337  the latter, which is pointed to by the former, which may also get additional    makes use of it. However, don't set the bit unless the length is greater than
1338  data set later by the calling program. At the moment, the size of    zero - the interpretive pcre_exec() and pcre_dfa_exec() needn't waste time
1339  pcre_study_data is fixed. We nevertheless save it in a field for returning via    checking the zero case. */
 the pcre_fullinfo() function so that if it becomes variable in the future, we  
 don't have to change that code. */  
1340    
1341  extra = (pcre_extra *)(pcre_malloc)    if (min > 0)
1342    (sizeof(pcre_extra) + sizeof(pcre_study_data));      {
1343        study->flags |= PCRE_STUDY_MINLEN;
1344        study->minlength = min;
1345        }
1346      else study->minlength = 0;
1347    
1348  if (extra == NULL)    /* If JIT support was compiled and requested, attempt the JIT compilation.
1349    {    If no starting bytes were found, and the minimum length is zero, and JIT
1350    *errorptr = "failed to get memory";    compilation fails, abandon the extra block and return NULL. */
1351    return NULL;  
1352    #ifdef SUPPORT_JIT
1353      extra->executable_jit = NULL;
1354      if ((options & PCRE_STUDY_JIT_COMPILE) != 0) _pcre_jit_compile(re, extra);
1355      if (study->flags == 0 && (extra->flags & PCRE_EXTRA_EXECUTABLE_JIT) == 0)
1356        {
1357        pcre_free_study(extra);
1358        extra = NULL;
1359        }
1360    #endif
1361    }    }
1362    
1363  study = (pcre_study_data *)((char *)extra + sizeof(pcre_extra));  return extra;
1364  extra->flags = PCRE_EXTRA_STUDY_DATA;  }
 extra->study_data = study;  
1365    
 study->size = sizeof(pcre_study_data);  
 study->flags = 0;  
1366    
1367  if (bits_set)  /*************************************************
1368    {  *          Free the study data                   *
1369    study->flags |= PCRE_STUDY_MAPPED;  *************************************************/
   memcpy(study->start_bits, start_bits, sizeof(start_bits));  
   }  
1370    
1371  if (min >= 0)  /* This function frees the memory that was obtained by pcre_study().
   {  
   study->flags |= PCRE_STUDY_MINLEN;  
   study->minlength = min;  
   }  
1372    
1373  return extra;  Argument:   a pointer to the pcre_extra block
1374    Returns:    nothing
1375    */
1376    
1377    PCRE_EXP_DEFN void
1378    pcre_free_study(pcre_extra *extra)
1379    {
1380    #ifdef SUPPORT_JIT
1381    if ((extra->flags & PCRE_EXTRA_EXECUTABLE_JIT) != 0 &&
1382         extra->executable_jit != NULL)
1383      _pcre_jit_free(extra->executable_jit);
1384    #endif
1385    pcre_free(extra);
1386  }  }
1387    
1388  /* End of pcre_study.c */  /* End of pcre_study.c */

Legend:
Removed from v.603  
changed lines
  Added in v.797

  ViewVC Help
Powered by ViewVC 1.1.5