/[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 1481 by ph10, Tue May 27 18:24:42 2014 UTC revision 1482 by ph10, Wed May 28 11:10:58 2014 UTC
# Line 5982  for (;; ptr++) Line 5982  for (;; ptr++)
5982            just adjust the length as if we had. Do some paranoid checks for            just adjust the length as if we had. Do some paranoid checks for
5983            potential integer overflow. The INT64_OR_DOUBLE type is a 64-bit            potential integer overflow. The INT64_OR_DOUBLE type is a 64-bit
5984            integer type when available, otherwise double. */            integer type when available, otherwise double. */
5985    
5986            if (lengthptr != NULL)            if (lengthptr != NULL)
5987              {              {
5988              int delta = (repeat_min - 1)*length_prevgroup;              int delta = (repeat_min - 1)*length_prevgroup;
# Line 6700  for (;; ptr++) Line 6700  for (;; ptr++)
6700              ptr++;              ptr++;
6701              }              }
6702            namelen = (int)(ptr - name);            namelen = (int)(ptr - name);
6703            if (lengthptr != NULL) *lengthptr += IMM2_SIZE;            if (lengthptr != NULL && (options & PCRE_DUPNAMES) != 0)
6704                *lengthptr += IMM2_SIZE;
6705            }            }
6706    
6707          /* Check the terminator */          /* Check the terminator */
# Line 6761  for (;; ptr++) Line 6762  for (;; ptr++)
6762            for (; i < cd->names_found; i++)            for (; i < cd->names_found; i++)
6763              {              {
6764              slot += cd->name_entry_size;              slot += cd->name_entry_size;
6765              if (STRNCMP_UC_UC(name, slot+IMM2_SIZE, namelen) != 0) break;              if (STRNCMP_UC_UC(name, slot+IMM2_SIZE, namelen) != 0 ||
6766                  (slot+IMM2_SIZE)[namelen] != 0) break;
6767              count++;              count++;
6768              }              }
6769    
6770            if (count > 1)            if (count > 1)
6771              {              {
6772              PUT2(code, 2+LINK_SIZE, offset);              PUT2(code, 2+LINK_SIZE, offset);
# Line 7112  for (;; ptr++) Line 7115  for (;; ptr++)
7115            /* Count named back references. */            /* Count named back references. */
7116    
7117            if (!is_recurse) cd->namedrefcount++;            if (!is_recurse) cd->namedrefcount++;
7118    
7119              /* If duplicate names are permitted, we have to allow for a named
7120              reference to a duplicated name (this cannot be determined until the
7121              second pass). This needs an extra 16-bit data item. */
7122    
7123              if ((options & PCRE_DUPNAMES) != 0) *lengthptr += IMM2_SIZE;
7124            }            }
7125    
7126          /* 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 7158  for (;; ptr++) Line 7167  for (;; ptr++)
7167            for (i++; i < cd->names_found; i++)            for (i++; i < cd->names_found; i++)
7168              {              {
7169              if (STRCMP_UC_UC(slot + IMM2_SIZE, cslot + IMM2_SIZE) != 0) break;              if (STRCMP_UC_UC(slot + IMM2_SIZE, cslot + IMM2_SIZE) != 0) break;
7170    
7171    
7172              count++;              count++;
7173              cslot += cd->name_entry_size;              cslot += cd->name_entry_size;
7174              }              }
7175    
7176            if (count > 1)            if (count > 1)
7177              {              {
7178              if (firstcharflags == REQ_UNSET) firstcharflags = REQ_NONE;              if (firstcharflags == REQ_UNSET) firstcharflags = REQ_NONE;

Legend:
Removed from v.1481  
changed lines
  Added in v.1482

  ViewVC Help
Powered by ViewVC 1.1.5