/[emacs]/emacs/src/regex.c
ViewVC logotype

Diff of /emacs/src/regex.c

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

revision 1.176.2.1 by miles, Fri Apr 4 06:21:03 2003 UTC revision 1.176.2.2 by miles, Tue Jul 6 08:50:28 2004 UTC
# Line 975  print_partial_compiled_pattern (start, e Line 975  print_partial_compiled_pattern (start, e
975              int has_range_table = CHARSET_RANGE_TABLE_EXISTS_P (p - 1);              int has_range_table = CHARSET_RANGE_TABLE_EXISTS_P (p - 1);
976    
977              fprintf (stderr, "/charset [%s",              fprintf (stderr, "/charset [%s",
978                      (re_opcode_t) *(p - 1) == charset_not ? "^" : "");                       (re_opcode_t) *(p - 1) == charset_not ? "^" : "");
979    
980              assert (p + *p < pend);              if (p + *p >= pend)
981                  fprintf (stderr, " !extends past end of pattern! ");
982    
983              for (c = 0; c < 256; c++)              for (c = 0; c < 256; c++)
984                if (c / 8 < length                if (c / 8 < length
# Line 1736  static int analyse_first _RE_ARGS ((re_c Line 1737  static int analyse_first _RE_ARGS ((re_c
1737    
1738    
1739  /* This is not an arbitrary limit: the arguments which represent offsets  /* This is not an arbitrary limit: the arguments which represent offsets
1740     into the pattern are two bytes long.  So if 2^16 bytes turns out to     into the pattern are two bytes long.  So if 2^15 bytes turns out to
1741     be too small, many things would have to change.  */     be too small, many things would have to change.  */
1742    # define MAX_BUF_SIZE (1L << 15)
1743    
1744    #if 0  /* This is when we thought it could be 2^16 bytes.  */
1745  /* Any other compiler which, like MSC, has allocation limit below 2^16  /* Any other compiler which, like MSC, has allocation limit below 2^16
1746     bytes will have to use approach similar to what was done below for     bytes will have to use approach similar to what was done below for
1747     MSC and drop MAX_BUF_SIZE a bit.  Otherwise you may end up     MSC and drop MAX_BUF_SIZE a bit.  Otherwise you may end up
# Line 1749  static int analyse_first _RE_ARGS ((re_c Line 1753  static int analyse_first _RE_ARGS ((re_c
1753  #else  #else
1754  # define MAX_BUF_SIZE (1L << 16)  # define MAX_BUF_SIZE (1L << 16)
1755  #endif  #endif
1756    #endif /* 0 */
1757    
1758  /* Extend the buffer by twice its current size via realloc and  /* Extend the buffer by twice its current size via realloc and
1759     reset the pointers that pointed into the old block to point to the     reset the pointers that pointed into the old block to point to the
# Line 3514  regex_compile (pattern, size, syntax, bu Line 3519  regex_compile (pattern, size, syntax, bu
3519    if (syntax & RE_NO_POSIX_BACKTRACKING)    if (syntax & RE_NO_POSIX_BACKTRACKING)
3520      BUF_PUSH (succeed);      BUF_PUSH (succeed);
3521    
   free (compile_stack.stack);  
   
3522    /* We have succeeded; set the length of the buffer.  */    /* We have succeeded; set the length of the buffer.  */
3523    bufp->used = b - bufp->buffer;    bufp->used = b - bufp->buffer;
3524    
# Line 3555  regex_compile (pattern, size, syntax, bu Line 3558  regex_compile (pattern, size, syntax, bu
3558    }    }
3559  #endif /* not MATCH_MAY_ALLOCATE */  #endif /* not MATCH_MAY_ALLOCATE */
3560    
3561    return REG_NOERROR;    FREE_STACK_RETURN (REG_NOERROR);
3562  } /* regex_compile */  } /* regex_compile */
3563    
3564  /* Subroutines for `regex_compile'.  */  /* Subroutines for `regex_compile'.  */
# Line 4458  skip_one_char (p) Line 4461  skip_one_char (p)
4461    
4462    
4463  /* Jump over non-matching operations.  */  /* Jump over non-matching operations.  */
4464  static unsigned char *  static re_char *
4465  skip_noops (p, pend)  skip_noops (p, pend)
4466       unsigned char *p, *pend;       re_char *p, *pend;
4467  {  {
4468    int mcnt;    int mcnt;
4469    while (p < pend)    while (p < pend)
# Line 4489  skip_noops (p, pend) Line 4492  skip_noops (p, pend)
4492  static int  static int
4493  mutually_exclusive_p (bufp, p1, p2)  mutually_exclusive_p (bufp, p1, p2)
4494       struct re_pattern_buffer *bufp;       struct re_pattern_buffer *bufp;
4495       unsigned char *p1, *p2;       re_char *p1, *p2;
4496  {  {
4497    re_opcode_t op2;    re_opcode_t op2;
4498    const boolean multibyte = RE_MULTIBYTE_P (bufp);    const boolean multibyte = RE_MULTIBYTE_P (bufp);
# Line 6327  regfree (preg) Line 6330  regfree (preg)
6330  WEAK_ALIAS (__regfree, regfree)  WEAK_ALIAS (__regfree, regfree)
6331    
6332  #endif /* not emacs  */  #endif /* not emacs  */
6333    
6334    /* arch-tag: 4ffd68ba-2a9e-435b-a21a-018990f9eeb2
6335       (do not change this comment) */

Legend:
Removed from v.1.176.2.1  
changed lines
  Added in v.1.176.2.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26