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

Diff of /code/trunk/pcre_compile.c

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

revision 1520 by ph10, Sun Feb 8 16:29:23 2015 UTC revision 1521 by ph10, Sun Feb 8 16:43:13 2015 UTC
# Line 6734  for (;; ptr++) Line 6734  for (;; ptr++)
6734              ptr++;              ptr++;
6735              }              }
6736            namelen = (int)(ptr - name);            namelen = (int)(ptr - name);
6737            if (lengthptr != NULL && (options & PCRE_DUPNAMES) != 0)            if (lengthptr != NULL) *lengthptr += IMM2_SIZE;
             *lengthptr += IMM2_SIZE;  
6738            }            }
6739    
6740          /* Check the terminator */          /* Check the terminator */
# Line 7152  for (;; ptr++) Line 7151  for (;; ptr++)
7151    
7152            if (!is_recurse) cd->namedrefcount++;            if (!is_recurse) cd->namedrefcount++;
7153    
7154            /* If duplicate names are permitted, we have to allow for a named            /* We have to allow for a named reference to a duplicated name (this
7155            reference to a duplicated name (this cannot be determined until the            cannot be determined until the second pass). This needs an extra
7156            second pass). This needs an extra 16-bit data item. */            16-bit data item. */
7157    
7158            if ((options & PCRE_DUPNAMES) != 0) *lengthptr += IMM2_SIZE;            *lengthptr += IMM2_SIZE;
7159            }            }
7160    
7161          /* In the real compile, search the name table. We check the name          /* In the real compile, search the name table. We check the name
# Line 9156  if (length > MAX_PATTERN_SIZE) Line 9155  if (length > MAX_PATTERN_SIZE)
9155    goto PCRE_EARLY_ERROR_RETURN;    goto PCRE_EARLY_ERROR_RETURN;
9156    }    }
9157    
 /* If there are groups with duplicate names and there are also references by  
 name, we must allow for the possibility of named references to duplicated  
 groups. These require an extra data item each. */  
   
 if (cd->dupnames && cd->namedrefcount > 0)  
   length += cd->namedrefcount * IMM2_SIZE * sizeof(pcre_uchar);  
   
9158  /* Compute the size of the data block for storing the compiled pattern. Integer  /* Compute the size of the data block for storing the compiled pattern. Integer
9159  overflow should no longer be possible because nowadays we limit the maximum  overflow should no longer be possible because nowadays we limit the maximum
9160  value of cd->names_found and cd->name_entry_size. */  value of cd->names_found and cd->name_entry_size. */

Legend:
Removed from v.1520  
changed lines
  Added in v.1521

  ViewVC Help
Powered by ViewVC 1.1.5