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

Diff of /code/trunk/pcre_dfa_exec.c

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

revision 428 by ph10, Mon Aug 31 17:10:26 2009 UTC revision 602 by ph10, Wed May 25 08:29:03 2011 UTC
# Line 7  and semantics are as close as possible t Line 7  and semantics are as close as possible t
7  below for why this module is different).  below for why this module is different).
8    
9                         Written by Philip Hazel                         Written by Philip Hazel
10             Copyright (c) 1997-2009 University of Cambridge             Copyright (c) 1997-2011 University of Cambridge
11    
12  -----------------------------------------------------------------------------  -----------------------------------------------------------------------------
13  Redistribution and use in source and binary forms, with or without  Redistribution and use in source and binary forms, with or without
# Line 45  FSM). This is NOT Perl- compatible, but Line 45  FSM). This is NOT Perl- compatible, but
45  applications. */  applications. */
46    
47    
48    /* NOTE ABOUT PERFORMANCE: A user of this function sent some code that improved
49    the performance of his patterns greatly. I could not use it as it stood, as it
50    was not thread safe, and made assumptions about pattern sizes. Also, it caused
51    test 7 to loop, and test 9 to crash with a segfault.
52    
53    The issue is the check for duplicate states, which is done by a simple linear
54    search up the state list. (Grep for "duplicate" below to find the code.) For
55    many patterns, there will never be many states active at one time, so a simple
56    linear search is fine. In patterns that have many active states, it might be a
57    bottleneck. The suggested code used an indexing scheme to remember which states
58    had previously been used for each character, and avoided the linear search when
59    it knew there was no chance of a duplicate. This was implemented when adding
60    states to the state lists.
61    
62    I wrote some thread-safe, not-limited code to try something similar at the time
63    of checking for duplicates (instead of when adding states), using index vectors
64    on the stack. It did give a 13% improvement with one specially constructed
65    pattern for certain subject strings, but on other strings and on many of the
66    simpler patterns in the test suite it did worse. The major problem, I think,
67    was the extra time to initialize the index. This had to be done for each call
68    of internal_dfa_exec(). (The supplied patch used a static vector, initialized
69    only once - I suspect this was the cause of the problems with the tests.)
70    
71    Overall, I concluded that the gains in some cases did not outweigh the losses
72    in others, so I abandoned this code. */
73    
74    
75    
76  #ifdef HAVE_CONFIG_H  #ifdef HAVE_CONFIG_H
77  #include "config.h"  #include "config.h"
78  #endif  #endif
# Line 78  never stored, so we push them well clear Line 106  never stored, so we push them well clear
106    
107    
108  /* This table identifies those opcodes that are followed immediately by a  /* This table identifies those opcodes that are followed immediately by a
109  character that is to be tested in some way. This makes is possible to  character that is to be tested in some way. This makes it possible to
110  centralize the loading of these characters. In the case of Type * etc, the  centralize the loading of these characters. In the case of Type * etc, the
111  "character" is the opcode for \D, \d, \S, \s, \W, or \w, which will always be a  "character" is the opcode for \D, \d, \S, \s, \W, or \w, which will always be a
112  small value. ***NOTE*** If the start of this table is modified, the two tables  small value. Non-zero values in the table are the offsets from the opcode where
113  that follow must also be modified. */  the character is to be found. ***NOTE*** If the start of this table is
114    modified, the three tables that follow must also be modified. */
115    
116  static const uschar coptable[] = {  static const uschar coptable[] = {
117    0,                             /* End                                    */    0,                             /* End                                    */
118    0, 0, 0, 0, 0,                 /* \A, \G, \K, \B, \b                     */    0, 0, 0, 0, 0,                 /* \A, \G, \K, \B, \b                     */
119    0, 0, 0, 0, 0, 0,              /* \D, \d, \S, \s, \W, \w                 */    0, 0, 0, 0, 0, 0,              /* \D, \d, \S, \s, \W, \w                 */
120    0, 0, 0,                       /* Any, AllAny, Anybyte                   */    0, 0, 0,                       /* Any, AllAny, Anybyte                   */
121    0, 0, 0,                       /* NOTPROP, PROP, EXTUNI                  */    0, 0,                          /* \P, \p                                 */
122    0, 0, 0, 0, 0,                 /* \R, \H, \h, \V, \v                     */    0, 0, 0, 0, 0,                 /* \R, \H, \h, \V, \v                     */
123    0, 0, 0, 0, 0,                 /* \Z, \z, Opt, ^, $                      */    0,                             /* \X                                     */
124      0, 0, 0, 0, 0, 0,              /* \Z, \z, ^, ^M, $, $M                   */
125    1,                             /* Char                                   */    1,                             /* Char                                   */
126    1,                             /* Charnc                                 */    1,                             /* Chari                                  */
127    1,                             /* not                                    */    1,                             /* not                                    */
128      1,                             /* noti                                   */
129    /* Positive single-char repeats                                          */    /* Positive single-char repeats                                          */
130    1, 1, 1, 1, 1, 1,              /* *, *?, +, +?, ?, ??                    */    1, 1, 1, 1, 1, 1,              /* *, *?, +, +?, ?, ??                    */
131    3, 3, 3,                       /* upto, minupto, exact                   */    3, 3, 3,                       /* upto, minupto, exact                   */
132    1, 1, 1, 3,                    /* *+, ++, ?+, upto+                      */    1, 1, 1, 3,                    /* *+, ++, ?+, upto+                      */
133      1, 1, 1, 1, 1, 1,              /* *I, *?I, +I, +?I, ?I, ??I              */
134      3, 3, 3,                       /* upto I, minupto I, exact I             */
135      1, 1, 1, 3,                    /* *+I, ++I, ?+I, upto+I                  */
136    /* Negative single-char repeats - only for chars < 256                   */    /* Negative single-char repeats - only for chars < 256                   */
137    1, 1, 1, 1, 1, 1,              /* NOT *, *?, +, +?, ?, ??                */    1, 1, 1, 1, 1, 1,              /* NOT *, *?, +, +?, ?, ??                */
138    3, 3, 3,                       /* NOT upto, minupto, exact               */    3, 3, 3,                       /* NOT upto, minupto, exact               */
139    1, 1, 1, 3,                    /* NOT *+, ++, ?+, updo+                  */    1, 1, 1, 3,                    /* NOT *+, ++, ?+, upto+                  */
140      1, 1, 1, 1, 1, 1,              /* NOT *I, *?I, +I, +?I, ?I, ??I          */
141      3, 3, 3,                       /* NOT upto I, minupto I, exact I         */
142      1, 1, 1, 3,                    /* NOT *+I, ++I, ?+I, upto+I              */
143    /* Positive type repeats                                                 */    /* Positive type repeats                                                 */
144    1, 1, 1, 1, 1, 1,              /* Type *, *?, +, +?, ?, ??               */    1, 1, 1, 1, 1, 1,              /* Type *, *?, +, +?, ?, ??               */
145    3, 3, 3,                       /* Type upto, minupto, exact              */    3, 3, 3,                       /* Type upto, minupto, exact              */
# Line 114  static const uschar coptable[] = { Line 151  static const uschar coptable[] = {
151    0,                             /* NCLASS                                 */    0,                             /* NCLASS                                 */
152    0,                             /* XCLASS - variable length               */    0,                             /* XCLASS - variable length               */
153    0,                             /* REF                                    */    0,                             /* REF                                    */
154      0,                             /* REFI                                   */
155    0,                             /* RECURSE                                */    0,                             /* RECURSE                                */
156    0,                             /* CALLOUT                                */    0,                             /* CALLOUT                                */
157    0,                             /* Alt                                    */    0,                             /* Alt                                    */
# Line 127  static const uschar coptable[] = { Line 165  static const uschar coptable[] = {
165    0,                             /* Reverse                                */    0,                             /* Reverse                                */
166    0, 0, 0, 0,                    /* ONCE, BRA, CBRA, COND                  */    0, 0, 0, 0,                    /* ONCE, BRA, CBRA, COND                  */
167    0, 0, 0,                       /* SBRA, SCBRA, SCOND                     */    0, 0, 0,                       /* SBRA, SCBRA, SCOND                     */
168    0,                             /* CREF                                   */    0, 0,                          /* CREF, NCREF                            */
169    0,                             /* RREF                                   */    0, 0,                          /* RREF, NRREF                            */
170    0,                             /* DEF                                    */    0,                             /* DEF                                    */
171    0, 0,                          /* BRAZERO, BRAMINZERO                    */    0, 0,                          /* BRAZERO, BRAMINZERO                    */
172    0, 0, 0, 0,                    /* PRUNE, SKIP, THEN, COMMIT              */    0, 0, 0,                       /* MARK, PRUNE, PRUNE_ARG,                */
173    0, 0, 0                        /* FAIL, ACCEPT, SKIPZERO                 */    0, 0, 0, 0,                    /* SKIP, SKIP_ARG, THEN, THEN_ARG,        */
174      0, 0, 0, 0, 0                  /* COMMIT, FAIL, ACCEPT, CLOSE, SKIPZERO  */
175    };
176    
177    /* This table identifies those opcodes that inspect a character. It is used to
178    remember the fact that a character could have been inspected when the end of
179    the subject is reached. ***NOTE*** If the start of this table is modified, the
180    two tables that follow must also be modified. */
181    
182    static const uschar poptable[] = {
183      0,                             /* End                                    */
184      0, 0, 0, 1, 1,                 /* \A, \G, \K, \B, \b                     */
185      1, 1, 1, 1, 1, 1,              /* \D, \d, \S, \s, \W, \w                 */
186      1, 1, 1,                       /* Any, AllAny, Anybyte                   */
187      1, 1,                          /* \P, \p                                 */
188      1, 1, 1, 1, 1,                 /* \R, \H, \h, \V, \v                     */
189      1,                             /* \X                                     */
190      0, 0, 0, 0, 0, 0,              /* \Z, \z, ^, ^M, $, $M                   */
191      1,                             /* Char                                   */
192      1,                             /* Chari                                  */
193      1,                             /* not                                    */
194      1,                             /* noti                                   */
195      /* Positive single-char repeats                                          */
196      1, 1, 1, 1, 1, 1,              /* *, *?, +, +?, ?, ??                    */
197      1, 1, 1,                       /* upto, minupto, exact                   */
198      1, 1, 1, 1,                    /* *+, ++, ?+, upto+                      */
199      1, 1, 1, 1, 1, 1,              /* *I, *?I, +I, +?I, ?I, ??I              */
200      1, 1, 1,                       /* upto I, minupto I, exact I             */
201      1, 1, 1, 1,                    /* *+I, ++I, ?+I, upto+I                  */
202      /* Negative single-char repeats - only for chars < 256                   */
203      1, 1, 1, 1, 1, 1,              /* NOT *, *?, +, +?, ?, ??                */
204      1, 1, 1,                       /* NOT upto, minupto, exact               */
205      1, 1, 1, 1,                    /* NOT *+, ++, ?+, upto+                  */
206      1, 1, 1, 1, 1, 1,              /* NOT *I, *?I, +I, +?I, ?I, ??I          */
207      1, 1, 1,                       /* NOT upto I, minupto I, exact I         */
208      1, 1, 1, 1,                    /* NOT *+I, ++I, ?+I, upto+I              */
209      /* Positive type repeats                                                 */
210      1, 1, 1, 1, 1, 1,              /* Type *, *?, +, +?, ?, ??               */
211      1, 1, 1,                       /* Type upto, minupto, exact              */
212      1, 1, 1, 1,                    /* Type *+, ++, ?+, upto+                 */
213      /* Character class & ref repeats                                         */
214      1, 1, 1, 1, 1, 1,              /* *, *?, +, +?, ?, ??                    */
215      1, 1,                          /* CRRANGE, CRMINRANGE                    */
216      1,                             /* CLASS                                  */
217      1,                             /* NCLASS                                 */
218      1,                             /* XCLASS - variable length               */
219      0,                             /* REF                                    */
220      0,                             /* REFI                                   */
221      0,                             /* RECURSE                                */
222      0,                             /* CALLOUT                                */
223      0,                             /* Alt                                    */
224      0,                             /* Ket                                    */
225      0,                             /* KetRmax                                */
226      0,                             /* KetRmin                                */
227      0,                             /* Assert                                 */
228      0,                             /* Assert not                             */
229      0,                             /* Assert behind                          */
230      0,                             /* Assert behind not                      */
231      0,                             /* Reverse                                */
232      0, 0, 0, 0,                    /* ONCE, BRA, CBRA, COND                  */
233      0, 0, 0,                       /* SBRA, SCBRA, SCOND                     */
234      0, 0,                          /* CREF, NCREF                            */
235      0, 0,                          /* RREF, NRREF                            */
236      0,                             /* DEF                                    */
237      0, 0,                          /* BRAZERO, BRAMINZERO                    */
238      0, 0, 0,                       /* MARK, PRUNE, PRUNE_ARG,                */
239      0, 0, 0, 0,                    /* SKIP, SKIP_ARG, THEN, THEN_ARG,        */
240      0, 0, 0, 0, 0                  /* COMMIT, FAIL, ACCEPT, CLOSE, SKIPZERO  */
241  };  };
242    
243  /* These 2 tables allow for compact code for testing for \D, \d, \S, \s, \W,  /* These 2 tables allow for compact code for testing for \D, \d, \S, \s, \W,
# Line 163  these structures in, is a vector of ints Line 268  these structures in, is a vector of ints
268  typedef struct stateblock {  typedef struct stateblock {
269    int offset;                     /* Offset to opcode */    int offset;                     /* Offset to opcode */
270    int count;                      /* Count for repeats */    int count;                      /* Count for repeats */
   int ims;                        /* ims flag bits */  
271    int data;                       /* Some use extra data */    int data;                       /* Some use extra data */
272  } stateblock;  } stateblock;
273    
274  #define INTS_PER_STATEBLOCK  (sizeof(stateblock)/sizeof(int))  #define INTS_PER_STATEBLOCK  (sizeof(stateblock)/sizeof(int))
275    
276    
277  #ifdef DEBUG  #ifdef PCRE_DEBUG
278  /*************************************************  /*************************************************
279  *             Print character string             *  *             Print character string             *
280  *************************************************/  *************************************************/
# Line 219  Arguments: Line 323  Arguments:
323    offsetcount       size of same    offsetcount       size of same
324    workspace         vector of workspace    workspace         vector of workspace
325    wscount           size of same    wscount           size of same
   ims               the current ims flags  
326    rlevel            function call recursion level    rlevel            function call recursion level
327    recursing         regex recursive call level    recursing         regex recursive call level
328    
# Line 236  for the current character, one for the f Line 339  for the current character, one for the f
339      { \      { \
340      next_active_state->offset = (x); \      next_active_state->offset = (x); \
341      next_active_state->count  = (y); \      next_active_state->count  = (y); \
     next_active_state->ims    = ims; \  
342      next_active_state++; \      next_active_state++; \
343      DPRINTF(("%.*sADD_ACTIVE(%d,%d)\n", rlevel*2-2, SP, (x), (y))); \      DPRINTF(("%.*sADD_ACTIVE(%d,%d)\n", rlevel*2-2, SP, (x), (y))); \
344      } \      } \
# Line 247  for the current character, one for the f Line 349  for the current character, one for the f
349      { \      { \
350      next_active_state->offset = (x); \      next_active_state->offset = (x); \
351      next_active_state->count  = (y); \      next_active_state->count  = (y); \
     next_active_state->ims    = ims; \  
352      next_active_state->data   = (z); \      next_active_state->data   = (z); \
353      next_active_state++; \      next_active_state++; \
354      DPRINTF(("%.*sADD_ACTIVE_DATA(%d,%d,%d)\n", rlevel*2-2, SP, (x), (y), (z))); \      DPRINTF(("%.*sADD_ACTIVE_DATA(%d,%d,%d)\n", rlevel*2-2, SP, (x), (y), (z))); \
# Line 259  for the current character, one for the f Line 360  for the current character, one for the f
360      { \      { \
361      next_new_state->offset = (x); \      next_new_state->offset = (x); \
362      next_new_state->count  = (y); \      next_new_state->count  = (y); \
     next_new_state->ims    = ims; \  
363      next_new_state++; \      next_new_state++; \
364      DPRINTF(("%.*sADD_NEW(%d,%d)\n", rlevel*2-2, SP, (x), (y))); \      DPRINTF(("%.*sADD_NEW(%d,%d)\n", rlevel*2-2, SP, (x), (y))); \
365      } \      } \
# Line 270  for the current character, one for the f Line 370  for the current character, one for the f
370      { \      { \
371      next_new_state->offset = (x); \      next_new_state->offset = (x); \
372      next_new_state->count  = (y); \      next_new_state->count  = (y); \
     next_new_state->ims    = ims; \  
373      next_new_state->data   = (z); \      next_new_state->data   = (z); \
374      next_new_state++; \      next_new_state++; \
375      DPRINTF(("%.*sADD_NEW_DATA(%d,%d,%d)\n", rlevel*2-2, SP, (x), (y), (z))); \      DPRINTF(("%.*sADD_NEW_DATA(%d,%d,%d)\n", rlevel*2-2, SP, (x), (y), (z))); \
# Line 289  internal_dfa_exec( Line 388  internal_dfa_exec(
388    int offsetcount,    int offsetcount,
389    int *workspace,    int *workspace,
390    int wscount,    int wscount,
   int ims,  
391    int  rlevel,    int  rlevel,
392    int  recursing)    int  recursing)
393  {  {
# Line 386  if (*first_op == OP_REVERSE) Line 484  if (*first_op == OP_REVERSE)
484    
485      {      {
486      gone_back = (current_subject - max_back < start_subject)?      gone_back = (current_subject - max_back < start_subject)?
487        current_subject - start_subject : max_back;        (int)(current_subject - start_subject) : max_back;
488      current_subject -= gone_back;      current_subject -= gone_back;
489      }      }
490    
491      /* Save the earliest consulted character */
492    
493      if (current_subject < md->start_used_ptr)
494        md->start_used_ptr = current_subject;
495    
496    /* Now we can process the individual branches. */    /* Now we can process the individual branches. */
497    
498    end_code = this_start_code;    end_code = this_start_code;
# Line 398  if (*first_op == OP_REVERSE) Line 501  if (*first_op == OP_REVERSE)
501      int back = GET(end_code, 2+LINK_SIZE);      int back = GET(end_code, 2+LINK_SIZE);
502      if (back <= gone_back)      if (back <= gone_back)
503        {        {
504        int bstate = end_code - start_code + 2 + 2*LINK_SIZE;        int bstate = (int)(end_code - start_code + 2 + 2*LINK_SIZE);
505        ADD_NEW_DATA(-bstate, 0, gone_back - back);        ADD_NEW_DATA(-bstate, 0, gone_back - back);
506        }        }
507      end_code += GET(end_code, 1);      end_code += GET(end_code, 1);
# Line 434  else Line 537  else
537        ((*this_start_code == OP_CBRA || *this_start_code == OP_SCBRA)? 2:0);        ((*this_start_code == OP_CBRA || *this_start_code == OP_SCBRA)? 2:0);
538      do      do
539        {        {
540        ADD_NEW(end_code - start_code + length, 0);        ADD_NEW((int)(end_code - start_code + length), 0);
541        end_code += GET(end_code, 1);        end_code += GET(end_code, 1);
542        length = 1 + LINK_SIZE;        length = 1 + LINK_SIZE;
543        }        }
# Line 455  for (;;) Line 558  for (;;)
558    int clen, dlen;    int clen, dlen;
559    unsigned int c, d;    unsigned int c, d;
560    int forced_fail = 0;    int forced_fail = 0;
561    int reached_end = 0;    BOOL could_continue = FALSE;
562    
563    /* Make the new state list into the active state list and empty the    /* Make the new state list into the active state list and empty the
564    new state list. */    new state list. */
# Line 469  for (;;) Line 572  for (;;)
572    workspace[0] ^= 1;              /* Remember for the restarting feature */    workspace[0] ^= 1;              /* Remember for the restarting feature */
573    workspace[1] = active_count;    workspace[1] = active_count;
574    
575  #ifdef DEBUG  #ifdef PCRE_DEBUG
576    printf("%.*sNext character: rest of subject = \"", rlevel*2-2, SP);    printf("%.*sNext character: rest of subject = \"", rlevel*2-2, SP);
577    pchars((uschar *)ptr, strlen((char *)ptr), stdout);    pchars((uschar *)ptr, strlen((char *)ptr), stdout);
578    printf("\"\n");    printf("\"\n");
# Line 511  for (;;) Line 614  for (;;)
614    for (i = 0; i < active_count; i++)    for (i = 0; i < active_count; i++)
615      {      {
616      stateblock *current_state = active_states + i;      stateblock *current_state = active_states + i;
617        BOOL caseless = FALSE;
618      const uschar *code;      const uschar *code;
619      int state_offset = current_state->offset;      int state_offset = current_state->offset;
620      int count, codevalue, rrc;      int count, codevalue, rrc;
621    
622  #ifdef DEBUG  #ifdef PCRE_DEBUG
623      printf ("%.*sProcessing state %d c=", rlevel*2-2, SP, state_offset);      printf ("%.*sProcessing state %d c=", rlevel*2-2, SP, state_offset);
624      if (clen == 0) printf("EOL\n");      if (clen == 0) printf("EOL\n");
625        else if (c > 32 && c < 127) printf("'%c'\n", c);        else if (c > 32 && c < 127) printf("'%c'\n", c);
626          else printf("0x%02x\n", c);          else printf("0x%02x\n", c);
627  #endif  #endif
628    
     /* This variable is referred to implicity in the ADD_xxx macros. */  
   
     ims = current_state->ims;  
   
629      /* A negative offset is a special case meaning "hold off going to this      /* A negative offset is a special case meaning "hold off going to this
630      (negated) state until the number of characters in the data field have      (negated) state until the number of characters in the data field have
631      been skipped". */      been skipped". */
# Line 545  for (;;) Line 645  for (;;)
645          }          }
646        }        }
647    
648      /* Check for a duplicate state with the same count, and skip if found. */      /* Check for a duplicate state with the same count, and skip if found.
649        See the note at the head of this module about the possibility of improving
650        performance here. */
651    
652      for (j = 0; j < i; j++)      for (j = 0; j < i; j++)
653        {        {
# Line 562  for (;;) Line 664  for (;;)
664      code = start_code + state_offset;      code = start_code + state_offset;
665      codevalue = *code;      codevalue = *code;
666    
667        /* If this opcode inspects a character, but we are at the end of the
668        subject, remember the fact for use when testing for a partial match. */
669    
670        if (clen == 0 && poptable[codevalue] != 0)
671          could_continue = TRUE;
672    
673      /* If this opcode is followed by an inline character, load it. It is      /* If this opcode is followed by an inline character, load it. It is
674      tempting to test for the presence of a subject character here, but that      tempting to test for the presence of a subject character here, but that
675      is wrong, because sometimes zero repetitions of the subject are      is wrong, because sometimes zero repetitions of the subject are
# Line 608  for (;;) Line 716  for (;;)
716    
717      switch (codevalue)      switch (codevalue)
718        {        {
719    /* ========================================================================== */
720          /* These cases are never obeyed. This is a fudge that causes a compile-
721          time error if the vectors coptable or poptable, which are indexed by
722          opcode, are not the correct length. It seems to be the only way to do
723          such a check at compile time, as the sizeof() operator does not work
724          in the C preprocessor. */
725    
726          case OP_TABLE_LENGTH:
727          case OP_TABLE_LENGTH +
728            ((sizeof(coptable) == OP_TABLE_LENGTH) &&
729             (sizeof(poptable) == OP_TABLE_LENGTH)):
730          break;
731    
732  /* ========================================================================== */  /* ========================================================================== */
733        /* Reached a closing bracket. If not at the end of the pattern, carry        /* Reached a closing bracket. If not at the end of the pattern, carry
734        on with the next opcode. Otherwise, unless we have an empty string and        on with the next opcode. Otherwise, unless we have an empty string and
735        PCRE_NOTEMPTY is set, save the match data, shifting up all previous        PCRE_NOTEMPTY is set, or PCRE_NOTEMPTY_ATSTART is set and we are at the
736          start of the subject, save the match data, shifting up all previous
737        matches so we always have the longest first. */        matches so we always have the longest first. */
738    
739        case OP_KET:        case OP_KET:
# Line 626  for (;;) Line 747  for (;;)
747            ADD_ACTIVE(state_offset - GET(code, 1), 0);            ADD_ACTIVE(state_offset - GET(code, 1), 0);
748            }            }
749          }          }
750        else        else
751          {          {
752          reached_end++;    /* Count branches that reach the end */          if (ptr > current_subject ||
753          if (ptr > current_subject || (md->moptions & PCRE_NOTEMPTY) == 0)              ((md->moptions & PCRE_NOTEMPTY) == 0 &&
754                  ((md->moptions & PCRE_NOTEMPTY_ATSTART) == 0 ||
755                    current_subject > start_subject + md->start_offset)))
756            {            {
757            if (match_count < 0) match_count = (offsetcount >= 2)? 1 : 0;            if (match_count < 0) match_count = (offsetcount >= 2)? 1 : 0;
758              else if (match_count > 0 && ++match_count * 2 >= offsetcount)              else if (match_count > 0 && ++match_count * 2 >= offsetcount)
# Line 638  for (;;) Line 761  for (;;)
761            if (count > 0) memmove(offsets + 2, offsets, count * sizeof(int));            if (count > 0) memmove(offsets + 2, offsets, count * sizeof(int));
762            if (offsetcount >= 2)            if (offsetcount >= 2)
763              {              {
764              offsets[0] = current_subject - start_subject;              offsets[0] = (int)(current_subject - start_subject);
765              offsets[1] = ptr - start_subject;              offsets[1] = (int)(ptr - start_subject);
766              DPRINTF(("%.*sSet matched string = \"%.*s\"\n", rlevel*2-2, SP,              DPRINTF(("%.*sSet matched string = \"%.*s\"\n", rlevel*2-2, SP,
767                offsets[1] - offsets[0], current_subject));                offsets[1] - offsets[0], current_subject));
768              }              }
# Line 650  for (;;) Line 773  for (;;)
773                match_count, rlevel*2-2, SP));                match_count, rlevel*2-2, SP));
774              return match_count;              return match_count;
775              }              }
776            }            }
777          }          }
778        break;        break;
779    
# Line 661  for (;;) Line 784  for (;;)
784        /*-----------------------------------------------------------------*/        /*-----------------------------------------------------------------*/
785        case OP_ALT:        case OP_ALT:
786        do { code += GET(code, 1); } while (*code == OP_ALT);        do { code += GET(code, 1); } while (*code == OP_ALT);
787        ADD_ACTIVE(code - start_code, 0);        ADD_ACTIVE((int)(code - start_code), 0);
788        break;        break;
789    
790        /*-----------------------------------------------------------------*/        /*-----------------------------------------------------------------*/
# Line 669  for (;;) Line 792  for (;;)
792        case OP_SBRA:        case OP_SBRA:
793        do        do
794          {          {
795          ADD_ACTIVE(code - start_code + 1 + LINK_SIZE, 0);          ADD_ACTIVE((int)(code - start_code + 1 + LINK_SIZE), 0);
796          code += GET(code, 1);          code += GET(code, 1);
797          }          }
798        while (*code == OP_ALT);        while (*code == OP_ALT);
# Line 678  for (;;) Line 801  for (;;)
801        /*-----------------------------------------------------------------*/        /*-----------------------------------------------------------------*/
802        case OP_CBRA:        case OP_CBRA:
803        case OP_SCBRA:        case OP_SCBRA:
804        ADD_ACTIVE(code - start_code + 3 + LINK_SIZE,  0);        ADD_ACTIVE((int)(code - start_code + 3 + LINK_SIZE),  0);
805        code += GET(code, 1);        code += GET(code, 1);
806        while (*code == OP_ALT)        while (*code == OP_ALT)
807          {          {
808          ADD_ACTIVE(code - start_code + 1 + LINK_SIZE,  0);          ADD_ACTIVE((int)(code - start_code + 1 + LINK_SIZE),  0);
809          code += GET(code, 1);          code += GET(code, 1);
810          }          }
811        break;        break;
# Line 693  for (;;) Line 816  for (;;)
816        ADD_ACTIVE(state_offset + 1, 0);        ADD_ACTIVE(state_offset + 1, 0);
817        code += 1 + GET(code, 2);        code += 1 + GET(code, 2);
818        while (*code == OP_ALT) code += GET(code, 1);        while (*code == OP_ALT) code += GET(code, 1);
819        ADD_ACTIVE(code - start_code + 1 + LINK_SIZE, 0);        ADD_ACTIVE((int)(code - start_code + 1 + LINK_SIZE), 0);
820        break;        break;
821    
822        /*-----------------------------------------------------------------*/        /*-----------------------------------------------------------------*/
823        case OP_SKIPZERO:        case OP_SKIPZERO:
824        code += 1 + GET(code, 2);        code += 1 + GET(code, 2);
825        while (*code == OP_ALT) code += GET(code, 1);        while (*code == OP_ALT) code += GET(code, 1);
826        ADD_ACTIVE(code - start_code + 1 + LINK_SIZE, 0);        ADD_ACTIVE((int)(code - start_code + 1 + LINK_SIZE), 0);
827        break;        break;
828    
829        /*-----------------------------------------------------------------*/        /*-----------------------------------------------------------------*/
830        case OP_CIRC:        case OP_CIRC:
831        if ((ptr == start_subject && (md->moptions & PCRE_NOTBOL) == 0) ||        if (ptr == start_subject && (md->moptions & PCRE_NOTBOL) == 0)
           ((ims & PCRE_MULTILINE) != 0 &&  
             ptr != end_subject &&  
             WAS_NEWLINE(ptr)))  
832          { ADD_ACTIVE(state_offset + 1, 0); }          { ADD_ACTIVE(state_offset + 1, 0); }
833        break;        break;
834    
835        /*-----------------------------------------------------------------*/        /*-----------------------------------------------------------------*/
836        case OP_EOD:        case OP_CIRCM:
837        if (ptr >= end_subject) { ADD_ACTIVE(state_offset + 1, 0); }        if ((ptr == start_subject && (md->moptions & PCRE_NOTBOL) == 0) ||
838              (ptr != end_subject && WAS_NEWLINE(ptr)))
839            { ADD_ACTIVE(state_offset + 1, 0); }
840        break;        break;
841    
842        /*-----------------------------------------------------------------*/        /*-----------------------------------------------------------------*/
843        case OP_OPT:        case OP_EOD:
844        ims = code[1];        if (ptr >= end_subject)
845        ADD_ACTIVE(state_offset + 2, 0);          {
846            if ((md->moptions & PCRE_PARTIAL_HARD) != 0)
847              could_continue = TRUE;
848            else { ADD_ACTIVE(state_offset + 1, 0); }
849            }
850        break;        break;
851    
852        /*-----------------------------------------------------------------*/        /*-----------------------------------------------------------------*/
# Line 754  for (;;) Line 880  for (;;)
880    
881        /*-----------------------------------------------------------------*/        /*-----------------------------------------------------------------*/
882        case OP_EODN:        case OP_EODN:
883        if (clen == 0 || (IS_NEWLINE(ptr) && ptr == end_subject - md->nllen))        if (clen == 0 && (md->moptions & PCRE_PARTIAL_HARD) != 0)
884            could_continue = TRUE;
885          else if (clen == 0 || (IS_NEWLINE(ptr) && ptr == end_subject - md->nllen))
886          { ADD_ACTIVE(state_offset + 1, 0); }          { ADD_ACTIVE(state_offset + 1, 0); }
887        break;        break;
888    
# Line 762  for (;;) Line 890  for (;;)
890        case OP_DOLL:        case OP_DOLL:
891        if ((md->moptions & PCRE_NOTEOL) == 0)        if ((md->moptions & PCRE_NOTEOL) == 0)
892          {          {
893          if (clen == 0 ||          if (clen == 0 && (md->moptions & PCRE_PARTIAL_HARD) != 0)
894              could_continue = TRUE;
895            else if (clen == 0 ||
896              ((md->poptions & PCRE_DOLLAR_ENDONLY) == 0 && IS_NEWLINE(ptr) &&              ((md->poptions & PCRE_DOLLAR_ENDONLY) == 0 && IS_NEWLINE(ptr) &&
897                 ((ims & PCRE_MULTILINE) != 0 || ptr == end_subject - md->nllen)                 (ptr == end_subject - md->nllen)
898              ))              ))
899            { ADD_ACTIVE(state_offset + 1, 0); }            { ADD_ACTIVE(state_offset + 1, 0); }
900          }          }
901        else if ((ims & PCRE_MULTILINE) != 0 && IS_NEWLINE(ptr))        break;
902    
903          /*-----------------------------------------------------------------*/
904          case OP_DOLLM:
905          if ((md->moptions & PCRE_NOTEOL) == 0)
906            {
907            if (clen == 0 && (md->moptions & PCRE_PARTIAL_HARD) != 0)
908              could_continue = TRUE;
909            else if (clen == 0 ||
910                ((md->poptions & PCRE_DOLLAR_ENDONLY) == 0 && IS_NEWLINE(ptr)))
911              { ADD_ACTIVE(state_offset + 1, 0); }
912            }
913          else if (IS_NEWLINE(ptr))
914          { ADD_ACTIVE(state_offset + 1, 0); }          { ADD_ACTIVE(state_offset + 1, 0); }
915        break;        break;
916    
# Line 800  for (;;) Line 942  for (;;)
942          if (ptr > start_subject)          if (ptr > start_subject)
943            {            {
944            const uschar *temp = ptr - 1;            const uschar *temp = ptr - 1;
945              if (temp < md->start_used_ptr) md->start_used_ptr = temp;
946  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
947            if (utf8) BACKCHAR(temp);            if (utf8) BACKCHAR(temp);
948  #endif  #endif
949            GETCHARTEST(d, temp);            GETCHARTEST(d, temp);
950    #ifdef SUPPORT_UCP
951              if ((md->poptions & PCRE_UCP) != 0)
952                {
953                if (d == '_') left_word = TRUE; else
954                  {
955                  int cat = UCD_CATEGORY(d);
956                  left_word = (cat == ucp_L || cat == ucp_N);
957                  }
958                }
959              else
960    #endif
961            left_word = d < 256 && (ctypes[d] & ctype_word) != 0;            left_word = d < 256 && (ctypes[d] & ctype_word) != 0;
962            }            }
963          else left_word = 0;          else left_word = FALSE;
964    
965          if (clen > 0)          if (clen > 0)
966              {
967    #ifdef SUPPORT_UCP
968              if ((md->poptions & PCRE_UCP) != 0)
969                {
970                if (c == '_') right_word = TRUE; else
971                  {
972                  int cat = UCD_CATEGORY(c);
973                  right_word = (cat == ucp_L || cat == ucp_N);
974                  }
975                }
976              else
977    #endif
978            right_word = c < 256 && (ctypes[c] & ctype_word) != 0;            right_word = c < 256 && (ctypes[c] & ctype_word) != 0;
979          else              /* This is a fudge to ensure that if this is the */            }
980            {               /* last item in the pattern, we don't count it as */          else right_word = FALSE;
           reached_end--;  /* reached, thus disabling a partial match. */  
           right_word = 0;  
           }  
981    
982          if ((left_word == right_word) == (codevalue == OP_NOT_WORD_BOUNDARY))          if ((left_word == right_word) == (codevalue == OP_NOT_WORD_BOUNDARY))
983            { ADD_ACTIVE(state_offset + 1, 0); }            { ADD_ACTIVE(state_offset + 1, 0); }
# Line 841  for (;;) Line 1004  for (;;)
1004            break;            break;
1005    
1006            case PT_LAMP:            case PT_LAMP:
1007            OK = prop->chartype == ucp_Lu || prop->chartype == ucp_Ll || prop->chartype == ucp_Lt;            OK = prop->chartype == ucp_Lu || prop->chartype == ucp_Ll ||
1008                   prop->chartype == ucp_Lt;
1009            break;            break;
1010    
1011            case PT_GC:            case PT_GC:
# Line 856  for (;;) Line 1020  for (;;)
1020            OK = prop->script == code[2];            OK = prop->script == code[2];
1021            break;            break;
1022    
1023              /* These are specials for combination cases. */
1024    
1025              case PT_ALNUM:
1026              OK = _pcre_ucp_gentype[prop->chartype] == ucp_L ||
1027                   _pcre_ucp_gentype[prop->chartype] == ucp_N;
1028              break;
1029    
1030              case PT_SPACE:    /* Perl space */
1031              OK = _pcre_ucp_gentype[prop->chartype] == ucp_Z ||
1032                   c == CHAR_HT || c == CHAR_NL || c == CHAR_FF || c == CHAR_CR;
1033              break;
1034    
1035              case PT_PXSPACE:  /* POSIX space */
1036              OK = _pcre_ucp_gentype[prop->chartype] == ucp_Z ||
1037                   c == CHAR_HT || c == CHAR_NL || c == CHAR_VT ||
1038                   c == CHAR_FF || c == CHAR_CR;
1039              break;
1040    
1041              case PT_WORD:
1042              OK = _pcre_ucp_gentype[prop->chartype] == ucp_L ||
1043                   _pcre_ucp_gentype[prop->chartype] == ucp_N ||
1044                   c == CHAR_UNDERSCORE;
1045              break;
1046    
1047            /* Should never occur, but keep compilers from grumbling. */            /* Should never occur, but keep compilers from grumbling. */
1048    
1049            default:            default:
# Line 1010  for (;;) Line 1198  for (;;)
1198            break;            break;
1199    
1200            case PT_LAMP:            case PT_LAMP:
1201            OK = prop->chartype == ucp_Lu || prop->chartype == ucp_Ll || prop->chartype == ucp_Lt;            OK = prop->chartype == ucp_Lu || prop->chartype == ucp_Ll ||
1202                prop->chartype == ucp_Lt;
1203            break;            break;
1204    
1205            case PT_GC:            case PT_GC:
# Line 1025  for (;;) Line 1214  for (;;)
1214            OK = prop->script == code[3];            OK = prop->script == code[3];
1215            break;            break;
1216    
1217              /* These are specials for combination cases. */
1218    
1219              case PT_ALNUM:
1220              OK = _pcre_ucp_gentype[prop->chartype] == ucp_L ||
1221                   _pcre_ucp_gentype[prop->chartype] == ucp_N;
1222              break;
1223    
1224              case PT_SPACE:    /* Perl space */
1225              OK = _pcre_ucp_gentype[prop->chartype] == ucp_Z ||
1226                   c == CHAR_HT || c == CHAR_NL || c == CHAR_FF || c == CHAR_CR;
1227              break;
1228    
1229              case PT_PXSPACE:  /* POSIX space */
1230              OK = _pcre_ucp_gentype[prop->chartype] == ucp_Z ||
1231                   c == CHAR_HT || c == CHAR_NL || c == CHAR_VT ||
1232                   c == CHAR_FF || c == CHAR_CR;
1233              break;
1234    
1235              case PT_WORD:
1236              OK = _pcre_ucp_gentype[prop->chartype] == ucp_L ||
1237                   _pcre_ucp_gentype[prop->chartype] == ucp_N ||
1238                   c == CHAR_UNDERSCORE;
1239              break;
1240    
1241            /* Should never occur, but keep compilers from grumbling. */            /* Should never occur, but keep compilers from grumbling. */
1242    
1243            default:            default:
# Line 1232  for (;;) Line 1445  for (;;)
1445            break;            break;
1446    
1447            case PT_LAMP:            case PT_LAMP:
1448            OK = prop->chartype == ucp_Lu || prop->chartype == ucp_Ll || prop->chartype == ucp_Lt;            OK = prop->chartype == ucp_Lu || prop->chartype == ucp_Ll ||
1449                prop->chartype == ucp_Lt;
1450            break;            break;
1451    
1452            case PT_GC:            case PT_GC:
# Line 1247  for (;;) Line 1461  for (;;)
1461            OK = prop->script == code[3];            OK = prop->script == code[3];
1462            break;            break;
1463    
1464              /* These are specials for combination cases. */
1465    
1466              case PT_ALNUM:
1467              OK = _pcre_ucp_gentype[prop->chartype] == ucp_L ||
1468                   _pcre_ucp_gentype[prop->chartype] == ucp_N;
1469              break;
1470    
1471              case PT_SPACE:    /* Perl space */
1472              OK = _pcre_ucp_gentype[prop->chartype] == ucp_Z ||
1473                   c == CHAR_HT || c == CHAR_NL || c == CHAR_FF || c == CHAR_CR;
1474              break;
1475    
1476              case PT_PXSPACE:  /* POSIX space */
1477              OK = _pcre_ucp_gentype[prop->chartype] == ucp_Z ||
1478                   c == CHAR_HT || c == CHAR_NL || c == CHAR_VT ||
1479                   c == CHAR_FF || c == CHAR_CR;
1480              break;
1481    
1482              case PT_WORD:
1483              OK = _pcre_ucp_gentype[prop->chartype] == ucp_L ||
1484                   _pcre_ucp_gentype[prop->chartype] == ucp_N ||
1485                   c == CHAR_UNDERSCORE;
1486              break;
1487    
1488            /* Should never occur, but keep compilers from grumbling. */            /* Should never occur, but keep compilers from grumbling. */
1489    
1490            default:            default:
# Line 1479  for (;;) Line 1717  for (;;)
1717            break;            break;
1718    
1719            case PT_LAMP:            case PT_LAMP:
1720            OK = prop->chartype == ucp_Lu || prop->chartype == ucp_Ll || prop->chartype == ucp_Lt;            OK = prop->chartype == ucp_Lu || prop->chartype == ucp_Ll ||
1721                prop->chartype == ucp_Lt;
1722            break;            break;
1723    
1724            case PT_GC:            case PT_GC:
# Line 1494  for (;;) Line 1733  for (;;)
1733            OK = prop->script == code[5];            OK = prop->script == code[5];
1734            break;            break;
1735    
1736              /* These are specials for combination cases. */
1737    
1738              case PT_ALNUM:
1739              OK = _pcre_ucp_gentype[prop->chartype] == ucp_L ||
1740                   _pcre_ucp_gentype[prop->chartype] == ucp_N;
1741              break;
1742    
1743              case PT_SPACE:    /* Perl space */
1744              OK = _pcre_ucp_gentype[prop->chartype] == ucp_Z ||
1745                   c == CHAR_HT || c == CHAR_NL || c == CHAR_FF || c == CHAR_CR;
1746              break;
1747    
1748              case PT_PXSPACE:  /* POSIX space */
1749              OK = _pcre_ucp_gentype[prop->chartype] == ucp_Z ||
1750                   c == CHAR_HT || c == CHAR_NL || c == CHAR_VT ||
1751                   c == CHAR_FF || c == CHAR_CR;
1752              break;
1753    
1754              case PT_WORD:
1755              OK = _pcre_ucp_gentype[prop->chartype] == ucp_L ||
1756                   _pcre_ucp_gentype[prop->chartype] == ucp_N ||
1757                   c == CHAR_UNDERSCORE;
1758              break;
1759    
1760            /* Should never occur, but keep compilers from grumbling. */            /* Should never occur, but keep compilers from grumbling. */
1761    
1762            default:            default:
# Line 1703  for (;;) Line 1966  for (;;)
1966        break;        break;
1967    
1968        /*-----------------------------------------------------------------*/        /*-----------------------------------------------------------------*/
1969        case OP_CHARNC:        case OP_CHARI:
1970        if (clen == 0) break;        if (clen == 0) break;
1971    
1972  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
# Line 1889  for (;;) Line 2152  for (;;)
2152        break;        break;
2153    
2154        /*-----------------------------------------------------------------*/        /*-----------------------------------------------------------------*/
2155        /* Match a negated single character. This is only used for one-byte        /* Match a negated single character casefully. This is only used for
2156        characters, that is, we know that d < 256. The character we are        one-byte characters, that is, we know that d < 256. The character we are
2157        checking (c) can be multibyte. */        checking (c) can be multibyte. */
2158    
2159        case OP_NOT:        case OP_NOT:
2160        if (clen > 0)        if (clen > 0 && c != d) { ADD_NEW(state_offset + dlen + 1, 0); }
2161          {        break;
2162          unsigned int otherd = ((ims & PCRE_CASELESS) != 0)? fcc[d] : d;  
2163          if (c != d && c != otherd) { ADD_NEW(state_offset + dlen + 1, 0); }        /*-----------------------------------------------------------------*/
2164          }        /* Match a negated single character caselessly. This is only used for
2165          one-byte characters, that is, we know that d < 256. The character we are
2166          checking (c) can be multibyte. */
2167    
2168          case OP_NOTI:
2169          if (clen > 0 && c != d && c != fcc[d])
2170            { ADD_NEW(state_offset + dlen + 1, 0); }
2171        break;        break;
2172    
2173        /*-----------------------------------------------------------------*/        /*-----------------------------------------------------------------*/
2174          case OP_PLUSI:
2175          case OP_MINPLUSI:
2176          case OP_POSPLUSI:
2177          case OP_NOTPLUSI:
2178          case OP_NOTMINPLUSI:
2179          case OP_NOTPOSPLUSI:
2180          caseless = TRUE;
2181          codevalue -= OP_STARI - OP_STAR;
2182    
2183          /* Fall through */
2184        case OP_PLUS:        case OP_PLUS:
2185        case OP_MINPLUS:        case OP_MINPLUS:
2186        case OP_POSPLUS:        case OP_POSPLUS:
# Line 1913  for (;;) Line 2192  for (;;)
2192        if (clen > 0)        if (clen > 0)
2193          {          {
2194          unsigned int otherd = NOTACHAR;          unsigned int otherd = NOTACHAR;
2195          if ((ims & PCRE_CASELESS) != 0)          if (caseless)
2196            {            {
2197  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
2198            if (utf8 && d >= 128)            if (utf8 && d >= 128)
# Line 1941  for (;;) Line 2220  for (;;)
2220        break;        break;
2221    
2222        /*-----------------------------------------------------------------*/        /*-----------------------------------------------------------------*/
2223          case OP_QUERYI:
2224          case OP_MINQUERYI:
2225          case OP_POSQUERYI:
2226          case OP_NOTQUERYI:
2227          case OP_NOTMINQUERYI:
2228          case OP_NOTPOSQUERYI:
2229          caseless = TRUE;
2230          codevalue -= OP_STARI - OP_STAR;
2231          /* Fall through */
2232        case OP_QUERY:        case OP_QUERY:
2233        case OP_MINQUERY:        case OP_MINQUERY:
2234        case OP_POSQUERY:        case OP_POSQUERY:
# Line 1951  for (;;) Line 2239  for (;;)
2239        if (clen > 0)        if (clen > 0)
2240          {          {
2241          unsigned int otherd = NOTACHAR;          unsigned int otherd = NOTACHAR;
2242          if ((ims & PCRE_CASELESS) != 0)          if (caseless)
2243            {            {
2244  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
2245            if (utf8 && d >= 128)            if (utf8 && d >= 128)
# Line 1977  for (;;) Line 2265  for (;;)
2265        break;        break;
2266    
2267        /*-----------------------------------------------------------------*/        /*-----------------------------------------------------------------*/
2268          case OP_STARI:
2269          case OP_MINSTARI:
2270          case OP_POSSTARI:
2271          case OP_NOTSTARI:
2272          case OP_NOTMINSTARI:
2273          case OP_NOTPOSSTARI:
2274          caseless = TRUE;
2275          codevalue -= OP_STARI - OP_STAR;
2276          /* Fall through */
2277        case OP_STAR:        case OP_STAR:
2278        case OP_MINSTAR:        case OP_MINSTAR:
2279        case OP_POSSTAR:        case OP_POSSTAR:
# Line 1987  for (;;) Line 2284  for (;;)
2284        if (clen > 0)        if (clen > 0)
2285          {          {
2286          unsigned int otherd = NOTACHAR;          unsigned int otherd = NOTACHAR;
2287          if ((ims & PCRE_CASELESS) != 0)          if (caseless)
2288            {            {
2289  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
2290            if (utf8 && d >= 128)            if (utf8 && d >= 128)
# Line 2013  for (;;) Line 2310  for (;;)
2310        break;        break;
2311    
2312        /*-----------------------------------------------------------------*/        /*-----------------------------------------------------------------*/
2313          case OP_EXACTI:
2314          case OP_NOTEXACTI:
2315          caseless = TRUE;
2316          codevalue -= OP_STARI - OP_STAR;
2317          /* Fall through */
2318        case OP_EXACT:        case OP_EXACT:
2319        case OP_NOTEXACT:        case OP_NOTEXACT:
2320        count = current_state->count;  /* Number already matched */        count = current_state->count;  /* Number already matched */
2321        if (clen > 0)        if (clen > 0)
2322          {          {
2323          unsigned int otherd = NOTACHAR;          unsigned int otherd = NOTACHAR;
2324          if ((ims & PCRE_CASELESS) != 0)          if (caseless)
2325            {            {
2326  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
2327            if (utf8 && d >= 128)            if (utf8 && d >= 128)
# Line 2043  for (;;) Line 2345  for (;;)
2345        break;        break;
2346    
2347        /*-----------------------------------------------------------------*/        /*-----------------------------------------------------------------*/
2348          case OP_UPTOI:
2349          case OP_MINUPTOI:
2350          case OP_POSUPTOI:
2351          case OP_NOTUPTOI:
2352          case OP_NOTMINUPTOI:
2353          case OP_NOTPOSUPTOI:
2354          caseless = TRUE;
2355          codevalue -= OP_STARI - OP_STAR;
2356          /* Fall through */
2357        case OP_UPTO:        case OP_UPTO:
2358        case OP_MINUPTO:        case OP_MINUPTO:
2359        case OP_POSUPTO:        case OP_POSUPTO:
# Line 2054  for (;;) Line 2365  for (;;)
2365        if (clen > 0)        if (clen > 0)
2366          {          {
2367          unsigned int otherd = NOTACHAR;          unsigned int otherd = NOTACHAR;
2368          if ((ims & PCRE_CASELESS) != 0)          if (caseless)
2369            {            {
2370  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
2371            if (utf8 && d >= 128)            if (utf8 && d >= 128)
# Line 2121  for (;;) Line 2432  for (;;)
2432          points to the byte after the end of the class. If there is a          points to the byte after the end of the class. If there is a
2433          quantifier, this is where it will be. */          quantifier, this is where it will be. */
2434    
2435          next_state_offset = ecode - start_code;          next_state_offset = (int)(ecode - start_code);
2436    
2437          switch (*ecode)          switch (*ecode)
2438            {            {
# Line 2192  for (;;) Line 2503  for (;;)
2503            md,                                   /* static match data */            md,                                   /* static match data */
2504            code,                                 /* this subexpression's code */            code,                                 /* this subexpression's code */
2505            ptr,                                  /* where we currently are */            ptr,                                  /* where we currently are */
2506            ptr - start_subject,                  /* start offset */            (int)(ptr - start_subject),           /* start offset */
2507            local_offsets,                        /* offset vector */            local_offsets,                        /* offset vector */
2508            sizeof(local_offsets)/sizeof(int),    /* size of same */            sizeof(local_offsets)/sizeof(int),    /* size of same */
2509            local_workspace,                      /* workspace vector */            local_workspace,                      /* workspace vector */
2510            sizeof(local_workspace)/sizeof(int),  /* size of same */            sizeof(local_workspace)/sizeof(int),  /* size of same */
           ims,                                  /* the current ims flags */  
2511            rlevel,                               /* function recursion level */            rlevel,                               /* function recursion level */
2512            recursing);                           /* pass on regex recursion */            recursing);                           /* pass on regex recursion */
2513    
2514            if (rc == PCRE_ERROR_DFA_UITEM) return rc;
2515          if ((rc >= 0) == (codevalue == OP_ASSERT || codevalue == OP_ASSERTBACK))          if ((rc >= 0) == (codevalue == OP_ASSERT || codevalue == OP_ASSERTBACK))
2516              { ADD_ACTIVE(endasscode + LINK_SIZE + 1 - start_code, 0); }              { ADD_ACTIVE((int)(endasscode + LINK_SIZE + 1 - start_code), 0); }
2517          }          }
2518        break;        break;
2519    
# Line 2229  for (;;) Line 2540  for (;;)
2540              cb.callout_number   = code[LINK_SIZE+2];              cb.callout_number   = code[LINK_SIZE+2];
2541              cb.offset_vector    = offsets;              cb.offset_vector    = offsets;
2542              cb.subject          = (PCRE_SPTR)start_subject;              cb.subject          = (PCRE_SPTR)start_subject;
2543              cb.subject_length   = end_subject - start_subject;              cb.subject_length   = (int)(end_subject - start_subject);
2544              cb.start_match      = current_subject - start_subject;              cb.start_match      = (int)(current_subject - start_subject);
2545              cb.current_position = ptr - start_subject;              cb.current_position = (int)(ptr - start_subject);
2546              cb.pattern_position = GET(code, LINK_SIZE + 3);              cb.pattern_position = GET(code, LINK_SIZE + 3);
2547              cb.next_item_length = GET(code, 3 + 2*LINK_SIZE);              cb.next_item_length = GET(code, 3 + 2*LINK_SIZE);
2548              cb.capture_top      = 1;              cb.capture_top      = 1;
# Line 2247  for (;;) Line 2558  for (;;)
2558    
2559          /* Back reference conditions are not supported */          /* Back reference conditions are not supported */
2560    
2561          if (condcode == OP_CREF) return PCRE_ERROR_DFA_UCOND;          if (condcode == OP_CREF || condcode == OP_NCREF)
2562              return PCRE_ERROR_DFA_UCOND;
2563    
2564          /* The DEFINE condition is always false */          /* The DEFINE condition is always false */
2565    
# Line 2258  for (;;) Line 2570  for (;;)
2570          which means "test if in any recursion". We can't test for specifically          which means "test if in any recursion". We can't test for specifically
2571          recursed groups. */          recursed groups. */
2572    
2573          else if (condcode == OP_RREF)          else if (condcode == OP_RREF || condcode == OP_NRREF)
2574            {            {
2575            int value = GET2(code, LINK_SIZE+2);            int value = GET2(code, LINK_SIZE+2);
2576            if (value != RREF_ANY) return PCRE_ERROR_DFA_UCOND;            if (value != RREF_ANY) return PCRE_ERROR_DFA_UCOND;
# Line 2281  for (;;) Line 2593  for (;;)
2593              md,                                   /* fixed match data */              md,                                   /* fixed match data */
2594              asscode,                              /* this subexpression's code */              asscode,                              /* this subexpression's code */
2595              ptr,                                  /* where we currently are */              ptr,                                  /* where we currently are */
2596              ptr - start_subject,                  /* start offset */              (int)(ptr - start_subject),           /* start offset */
2597              local_offsets,                        /* offset vector */              local_offsets,                        /* offset vector */
2598              sizeof(local_offsets)/sizeof(int),    /* size of same */              sizeof(local_offsets)/sizeof(int),    /* size of same */
2599              local_workspace,                      /* workspace vector */              local_workspace,                      /* workspace vector */
2600              sizeof(local_workspace)/sizeof(int),  /* size of same */              sizeof(local_workspace)/sizeof(int),  /* size of same */
             ims,                                  /* the current ims flags */  
2601              rlevel,                               /* function recursion level */              rlevel,                               /* function recursion level */
2602              recursing);                           /* pass on regex recursion */              recursing);                           /* pass on regex recursion */
2603    
2604              if (rc == PCRE_ERROR_DFA_UITEM) return rc;
2605            if ((rc >= 0) ==            if ((rc >= 0) ==
2606                  (condcode == OP_ASSERT || condcode == OP_ASSERTBACK))                  (condcode == OP_ASSERT || condcode == OP_ASSERTBACK))
2607              { ADD_ACTIVE(endasscode + LINK_SIZE + 1 - start_code, 0); }              { ADD_ACTIVE((int)(endasscode + LINK_SIZE + 1 - start_code), 0); }
2608            else            else
2609              { ADD_ACTIVE(state_offset + codelink + LINK_SIZE + 1, 0); }              { ADD_ACTIVE(state_offset + codelink + LINK_SIZE + 1, 0); }
2610            }            }
# Line 2313  for (;;) Line 2625  for (;;)
2625            md,                                   /* fixed match data */            md,                                   /* fixed match data */
2626            start_code + GET(code, 1),            /* this subexpression's code */            start_code + GET(code, 1),            /* this subexpression's code */
2627            ptr,                                  /* where we currently are */            ptr,                                  /* where we currently are */
2628            ptr - start_subject,                  /* start offset */            (int)(ptr - start_subject),           /* start offset */
2629            local_offsets,                        /* offset vector */            local_offsets,                        /* offset vector */
2630            sizeof(local_offsets)/sizeof(int),    /* size of same */            sizeof(local_offsets)/sizeof(int),    /* size of same */
2631            local_workspace,                      /* workspace vector */            local_workspace,                      /* workspace vector */
2632            sizeof(local_workspace)/sizeof(int),  /* size of same */            sizeof(local_workspace)/sizeof(int),  /* size of same */
           ims,                                  /* the current ims flags */  
2633            rlevel,                               /* function recursion level */            rlevel,                               /* function recursion level */
2634            recursing + 1);                       /* regex recurse level */            recursing + 1);                       /* regex recurse level */
2635    
# Line 2365  for (;;) Line 2676  for (;;)
2676            md,                                   /* fixed match data */            md,                                   /* fixed match data */
2677            code,                                 /* this subexpression's code */            code,                                 /* this subexpression's code */
2678            ptr,                                  /* where we currently are */            ptr,                                  /* where we currently are */
2679            ptr - start_subject,                  /* start offset */            (int)(ptr - start_subject),           /* start offset */
2680            local_offsets,                        /* offset vector */            local_offsets,                        /* offset vector */
2681            sizeof(local_offsets)/sizeof(int),    /* size of same */            sizeof(local_offsets)/sizeof(int),    /* size of same */
2682            local_workspace,                      /* workspace vector */            local_workspace,                      /* workspace vector */
2683            sizeof(local_workspace)/sizeof(int),  /* size of same */            sizeof(local_workspace)/sizeof(int),  /* size of same */
           ims,                                  /* the current ims flags */  
2684            rlevel,                               /* function recursion level */            rlevel,                               /* function recursion level */
2685            recursing);                           /* pass on regex recursion */            recursing);                           /* pass on regex recursion */
2686    
# Line 2382  for (;;) Line 2692  for (;;)
2692    
2693            do { end_subpattern += GET(end_subpattern, 1); }            do { end_subpattern += GET(end_subpattern, 1); }
2694              while (*end_subpattern == OP_ALT);              while (*end_subpattern == OP_ALT);
2695            next_state_offset = end_subpattern - start_code + LINK_SIZE + 1;            next_state_offset =
2696                (int)(end_subpattern - start_code + LINK_SIZE + 1);
2697    
2698            /* If the end of this subpattern is KETRMAX or KETRMIN, we must            /* If the end of this subpattern is KETRMAX or KETRMIN, we must
2699            arrange for the repeat state also to be added to the relevant list.            arrange for the repeat state also to be added to the relevant list.
# Line 2390  for (;;) Line 2701  for (;;)
2701    
2702            repeat_state_offset = (*end_subpattern == OP_KETRMAX ||            repeat_state_offset = (*end_subpattern == OP_KETRMAX ||
2703                                   *end_subpattern == OP_KETRMIN)?                                   *end_subpattern == OP_KETRMIN)?
2704              end_subpattern - start_code - GET(end_subpattern, 1) : -1;              (int)(end_subpattern - start_code - GET(end_subpattern, 1)) : -1;
2705    
2706            /* If we have matched an empty string, add the next state at the            /* If we have matched an empty string, add the next state at the
2707            current character pointer. This is important so that the duplicate            current character pointer. This is important so that the duplicate
# Line 2454  for (;;) Line 2765  for (;;)
2765          cb.callout_number   = code[1];          cb.callout_number   = code[1];
2766          cb.offset_vector    = offsets;          cb.offset_vector    = offsets;
2767          cb.subject          = (PCRE_SPTR)start_subject;          cb.subject          = (PCRE_SPTR)start_subject;
2768          cb.subject_length   = end_subject - start_subject;          cb.subject_length   = (int)(end_subject - start_subject);
2769          cb.start_match      = current_subject - start_subject;          cb.start_match      = (int)(current_subject - start_subject);
2770          cb.current_position = ptr - start_subject;          cb.current_position = (int)(ptr - start_subject);
2771          cb.pattern_position = GET(code, 2);          cb.pattern_position = GET(code, 2);
2772          cb.next_item_length = GET(code, 2 + LINK_SIZE);          cb.next_item_length = GET(code, 2 + LINK_SIZE);
2773          cb.capture_top      = 1;          cb.capture_top      = 1;
# Line 2481  for (;;) Line 2792  for (;;)
2792    /* We have finished the processing at the current subject character. If no    /* We have finished the processing at the current subject character. If no
2793    new states have been set for the next character, we have found all the    new states have been set for the next character, we have found all the
2794    matches that we are going to find. If we are at the top level and partial    matches that we are going to find. If we are at the top level and partial
2795    matching has been requested, check for appropriate conditions. The "forced_    matching has been requested, check for appropriate conditions.
2796    fail" variable counts the number of (*F) encountered for the character. If it  
2797    is equal to the original active_count (saved in workspace[1]) it means that    The "forced_ fail" variable counts the number of (*F) encountered for the
2798    (*F) was found on every active state. In this case we don't want to give a    character. If it is equal to the original active_count (saved in
2799    partial match. */    workspace[1]) it means that (*F) was found on every active state. In this
2800      case we don't want to give a partial match.
2801    
2802      The "could_continue" variable is true if a state could have continued but
2803      for the fact that the end of the subject was reached. */
2804    
2805    if (new_count <= 0)    if (new_count <= 0)
2806      {      {
2807      if (rlevel == 1 &&                               /* Top level, and */      if (rlevel == 1 &&                               /* Top level, and */
2808          reached_end != workspace[1] &&               /* Not all reached end */          could_continue &&                            /* Some could go on */
2809          forced_fail != workspace[1] &&               /* Not all forced fail & */          forced_fail != workspace[1] &&               /* Not all forced fail & */
2810          (                                            /* either... */          (                                            /* either... */
2811          (md->moptions & PCRE_PARTIAL_HARD) != 0      /* Hard partial */          (md->moptions & PCRE_PARTIAL_HARD) != 0      /* Hard partial */
# Line 2498  for (;;) Line 2813  for (;;)
2813          ((md->moptions & PCRE_PARTIAL_SOFT) != 0 &&  /* Soft partial and */          ((md->moptions & PCRE_PARTIAL_SOFT) != 0 &&  /* Soft partial and */
2814           match_count < 0)                            /* no matches */           match_count < 0)                            /* no matches */
2815          ) &&                                         /* And... */          ) &&                                         /* And... */
2816          ptr >= end_subject &&                     /* Reached end of subject */          ptr >= end_subject &&                  /* Reached end of subject */
2817          ptr > current_subject)                    /* Matched non-empty string */          ptr > md->start_used_ptr)              /* Inspected non-empty string */
2818        {        {
2819        if (offsetcount >= 2)        if (offsetcount >= 2)
2820          {          {
2821          offsets[0] = current_subject - start_subject;          offsets[0] = (int)(md->start_used_ptr - start_subject);
2822          offsets[1] = end_subject - start_subject;          offsets[1] = (int)(end_subject - start_subject);
2823          }          }
2824        match_count = PCRE_ERROR_PARTIAL;        match_count = PCRE_ERROR_PARTIAL;
2825        }        }
# Line 2589  if (re == NULL || subject == NULL || wor Line 2904  if (re == NULL || subject == NULL || wor
2904     (offsets == NULL && offsetcount > 0)) return PCRE_ERROR_NULL;     (offsets == NULL && offsetcount > 0)) return PCRE_ERROR_NULL;
2905  if (offsetcount < 0) return PCRE_ERROR_BADCOUNT;  if (offsetcount < 0) return PCRE_ERROR_BADCOUNT;
2906  if (wscount < 20) return PCRE_ERROR_DFA_WSSIZE;  if (wscount < 20) return PCRE_ERROR_DFA_WSSIZE;
2907    if (start_offset < 0 || start_offset > length) return PCRE_ERROR_BADOFFSET;
2908    
2909  /* We need to find the pointer to any study data before we test for byte  /* We need to find the pointer to any study data before we test for byte
2910  flipping, so we scan the extra_data block first. This may set two fields in the  flipping, so we scan the extra_data block first. This may set two fields in the
# Line 2645  md->start_code = (const uschar *)argumen Line 2961  md->start_code = (const uschar *)argumen
2961      re->name_table_offset + re->name_count * re->name_entry_size;      re->name_table_offset + re->name_count * re->name_entry_size;
2962  md->start_subject = (const unsigned char *)subject;  md->start_subject = (const unsigned char *)subject;
2963  md->end_subject = end_subject;  md->end_subject = end_subject;
2964    md->start_offset = start_offset;
2965  md->moptions = options;  md->moptions = options;
2966  md->poptions = re->options;  md->poptions = re->options;
2967    
# Line 2706  back the character offset. */ Line 3023  back the character offset. */
3023  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
3024  if (utf8 && (options & PCRE_NO_UTF8_CHECK) == 0)  if (utf8 && (options & PCRE_NO_UTF8_CHECK) == 0)
3025    {    {
3026    if (_pcre_valid_utf8((uschar *)subject, length) >= 0)    int errorcode;
3027      return PCRE_ERROR_BADUTF8;    int tb = _pcre_valid_utf8((uschar *)subject, length, &errorcode);
3028    if (start_offset > 0 && start_offset < length)    if (tb >= 0)
3029      {      {
3030      int tb = ((uschar *)subject)[start_offset];      if (offsetcount >= 2)
     if (tb > 127)  
3031        {        {
3032        tb &= 0xc0;        offsets[0] = tb;
3033        if (tb != 0 && tb != 0xc0) return PCRE_ERROR_BADUTF8_OFFSET;        offsets[1] = errorcode;
3034        }        }
3035        return (errorcode <= PCRE_UTF8_ERR5 && (options & PCRE_PARTIAL_HARD) != 0)?
3036          PCRE_ERROR_SHORTUTF8 : PCRE_ERROR_BADUTF8;
3037        }
3038      if (start_offset > 0 && start_offset < length)
3039        {
3040        tb = ((USPTR)subject)[start_offset] & 0xc0;
3041        if (tb == 0x80) return PCRE_ERROR_BADUTF8_OFFSET;
3042      }      }
3043    }    }
3044  #endif  #endif
# Line 2749  if (!anchored) Line 3072  if (!anchored)
3072      }      }
3073    else    else
3074      {      {
3075      if (startline && study != NULL &&      if (!startline && study != NULL &&
3076           (study->options & PCRE_STUDY_MAPPED) != 0)           (study->flags & PCRE_STUDY_MAPPED) != 0)
3077        start_bits = study->start_bits;        start_bits = study->start_bits;
3078      }      }
3079    }    }
# Line 2801  for (;;) Line 3124  for (;;)
3124        }        }
3125    
3126      /* There are some optimizations that avoid running the match if a known      /* There are some optimizations that avoid running the match if a known
3127      starting point is not found, or if a known later character is not present.      starting point is not found. However, there is an option that disables
3128      However, there is an option that disables these, for testing and for      these, for testing and for ensuring that all callouts do actually occur.
3129      ensuring that all callouts do actually occur. */      The option can be set in the regex by (*NO_START_OPT) or passed in
3130        match-time options. */
3131    
3132      if ((options & PCRE_NO_START_OPTIMIZE) == 0)      if (((options | re->options) & PCRE_NO_START_OPTIMIZE) == 0)
3133        {        {
   
3134        /* Advance to a known first byte. */        /* Advance to a known first byte. */
3135    
3136        if (first_byte >= 0)        if (first_byte >= 0)
# Line 2864  for (;;) Line 3187  for (;;)
3187          while (current_subject < end_subject)          while (current_subject < end_subject)
3188            {            {
3189            register unsigned int c = *current_subject;            register unsigned int c = *current_subject;
3190            if ((start_bits[c/8] & (1 << (c&7))) == 0) current_subject++;            if ((start_bits[c/8] & (1 << (c&7))) == 0)
3191              else break;              {
3192                current_subject++;
3193    #ifdef SUPPORT_UTF8
3194                if (utf8)
3195                  while(current_subject < end_subject &&
3196                        (*current_subject & 0xc0) == 0x80) current_subject++;
3197    #endif
3198                }
3199              else break;
3200            }            }
3201          }          }
3202        }        }
# Line 2873  for (;;) Line 3204  for (;;)
3204      /* Restore fudged end_subject */      /* Restore fudged end_subject */
3205    
3206      end_subject = save_end_subject;      end_subject = save_end_subject;
     }  
3207    
3208    /* If req_byte is set, we know that that character must appear in the subject      /* The following two optimizations are disabled for partial matching or if
3209    for the match to succeed. If the first character is set, req_byte must be      disabling is explicitly requested (and of course, by the test above, this
3210    later in the subject; otherwise the test starts at the match point. This      code is not obeyed when restarting after a partial match). */
   optimization can save a huge amount of work in patterns with nested unlimited  
   repeats that aren't going to match. Writing separate code for cased/caseless  
   versions makes it go faster, as does using an autoincrement and backing off  
   on a match.  
   
   HOWEVER: when the subject string is very, very long, searching to its end can  
   take a long time, and give bad performance on quite ordinary patterns. This  
   showed up when somebody was matching /^C/ on a 32-megabyte string... so we  
   don't do this when the string is sufficiently long.  
   
   ALSO: this processing is disabled when partial matching is requested, and can  
   also be explicitly deactivated. Furthermore, we have to disable when  
   restarting after a partial match, because the required character may have  
   already been matched. */  
   
   if ((options & PCRE_NO_START_OPTIMIZE) == 0 &&  
       req_byte >= 0 &&  
       end_subject - current_subject < REQ_BYTE_MAX &&  
       (options & (PCRE_PARTIAL_HARD|PCRE_PARTIAL_SOFT|PCRE_DFA_RESTART)) == 0)  
     {  
     register const uschar *p = current_subject + ((first_byte >= 0)? 1 : 0);  
3211    
3212      /* We don't need to repeat the search if we haven't yet reached the      if ((options & PCRE_NO_START_OPTIMIZE) == 0 &&
3213      place we found it at last time. */          (options & (PCRE_PARTIAL_HARD|PCRE_PARTIAL_SOFT)) == 0)
   
     if (p > req_byte_ptr)  
3214        {        {
3215        if (req_byte_caseless)        /* If the pattern was studied, a minimum subject length may be set. This
3216          {        is a lower bound; no actual string of that length may actually match the
3217          while (p < end_subject)        pattern. Although the value is, strictly, in characters, we treat it as
3218            {        bytes to avoid spending too much time in this optimization. */
3219            register int pp = *p++;  
3220            if (pp == req_byte || pp == req_byte2) { p--; break; }        if (study != NULL && (study->flags & PCRE_STUDY_MINLEN) != 0 &&
3221            }            (pcre_uint32)(end_subject - current_subject) < study->minlength)
3222          }          return PCRE_ERROR_NOMATCH;
3223        else  
3224          /* If req_byte is set, we know that that character must appear in the
3225          subject for the match to succeed. If the first character is set, req_byte
3226          must be later in the subject; otherwise the test starts at the match
3227          point. This optimization can save a huge amount of work in patterns with
3228          nested unlimited repeats that aren't going to match. Writing separate
3229          code for cased/caseless versions makes it go faster, as does using an
3230          autoincrement and backing off on a match.
3231    
3232          HOWEVER: when the subject string is very, very long, searching to its end
3233          can take a long time, and give bad performance on quite ordinary
3234          patterns. This showed up when somebody was matching /^C/ on a 32-megabyte
3235          string... so we don't do this when the string is sufficiently long. */
3236    
3237          if (req_byte >= 0 && end_subject - current_subject < REQ_BYTE_MAX)
3238          {          {
3239          while (p < end_subject)          register const uschar *p = current_subject + ((first_byte >= 0)? 1 : 0);
3240    
3241            /* We don't need to repeat the search if we haven't yet reached the
3242            place we found it at last time. */
3243    
3244            if (p > req_byte_ptr)
3245            {            {
3246            if (*p++ == req_byte) { p--; break; }            if (req_byte_caseless)
3247            }              {
3248          }              while (p < end_subject)
3249                  {
3250                  register int pp = *p++;
3251                  if (pp == req_byte || pp == req_byte2) { p--; break; }
3252                  }
3253                }
3254              else
3255                {
3256                while (p < end_subject)
3257                  {
3258                  if (*p++ == req_byte) { p--; break; }
3259                  }
3260                }
3261    
3262        /* If we can't find the required character, break the matching loop,            /* If we can't find the required character, break the matching loop,
3263        which will cause a return or PCRE_ERROR_NOMATCH. */            which will cause a return or PCRE_ERROR_NOMATCH. */
3264    
3265        if (p >= end_subject) break;            if (p >= end_subject) break;
3266    
3267        /* If we have found the required character, save the point where we            /* If we have found the required character, save the point where we
3268        found it, so that we don't search again next time round the loop if            found it, so that we don't search again next time round the loop if
3269        the start hasn't passed this character yet. */            the start hasn't passed this character yet. */
3270    
3271        req_byte_ptr = p;            req_byte_ptr = p;
3272              }
3273            }
3274        }        }
3275      }      }   /* End of optimizations that are done when not restarting */
3276    
3277    /* OK, now we can do the business */    /* OK, now we can do the business */
3278    
3279      md->start_used_ptr = current_subject;
3280    
3281    rc = internal_dfa_exec(    rc = internal_dfa_exec(
3282      md,                                /* fixed match data */      md,                                /* fixed match data */
3283      md->start_code,                    /* this subexpression's code */      md->start_code,                    /* this subexpression's code */
# Line 2945  for (;;) Line 3287  for (;;)
3287      offsetcount,                       /* size of same */      offsetcount,                       /* size of same */
3288      workspace,                         /* workspace vector */      workspace,                         /* workspace vector */
3289      wscount,                           /* size of same */      wscount,                           /* size of same */
     re->options & (PCRE_CASELESS|PCRE_MULTILINE|PCRE_DOTALL), /* ims flags */  
3290      0,                                 /* function recurse level */      0,                                 /* function recurse level */
3291      0);                                /* regex recurse level */      0);                                /* regex recurse level */
3292    

Legend:
Removed from v.428  
changed lines
  Added in v.602

  ViewVC Help
Powered by ViewVC 1.1.5