/[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 1538 by ph10, Sun Mar 29 11:22:24 2015 UTC revision 1540 by ph10, Sun Mar 29 17:41:16 2015 UTC
# Line 2497  for (code = first_significant_code(code Line 2497  for (code = first_significant_code(code
2497        empty_branch = FALSE;        empty_branch = FALSE;
2498        do        do
2499          {          {
2500          if (!empty_branch && could_be_empty_branch(code, endcode, utf, cd,          if (!empty_branch && could_be_empty_branch(code, endcode, utf, cd,
2501            recurses)) empty_branch = TRUE;            recurses)) empty_branch = TRUE;
2502          code += GET(code, 1);          code += GET(code, 1);
2503          }          }
# Line 5924  for (;; ptr++) Line 5924  for (;; ptr++)
5924        {        {
5925        register int i;        register int i;
5926        int len = (int)(code - previous);        int len = (int)(code - previous);
5927          size_t base_hwm_offset = save_hwm_offset;
5928        pcre_uchar *bralink = NULL;        pcre_uchar *bralink = NULL;
5929        pcre_uchar *brazeroptr = NULL;        pcre_uchar *brazeroptr = NULL;
5930    
# Line 6070  for (;; ptr++) Line 6071  for (;; ptr++)
6071    
6072                while (cd->hwm > cd->start_workspace + cd->workspace_size -                while (cd->hwm > cd->start_workspace + cd->workspace_size -
6073                       WORK_SIZE_SAFETY_MARGIN -                       WORK_SIZE_SAFETY_MARGIN -
6074                       (this_hwm_offset - save_hwm_offset))                       (this_hwm_offset - base_hwm_offset))
6075                  {                  {
6076                  *errorcodeptr = expand_workspace(cd);                  *errorcodeptr = expand_workspace(cd);
6077                  if (*errorcodeptr != 0) goto FAILED;                  if (*errorcodeptr != 0) goto FAILED;
6078                  }                  }
6079    
6080                for (hc = (pcre_uchar *)cd->start_workspace + save_hwm_offset;                for (hc = (pcre_uchar *)cd->start_workspace + base_hwm_offset;
6081                     hc < (pcre_uchar *)cd->start_workspace + this_hwm_offset;                     hc < (pcre_uchar *)cd->start_workspace + this_hwm_offset;
6082                     hc += LINK_SIZE)                     hc += LINK_SIZE)
6083                  {                  {
6084                  PUT(cd->hwm, 0, GET(hc, 0) + len);                  PUT(cd->hwm, 0, GET(hc, 0) + len);
6085                  cd->hwm += LINK_SIZE;                  cd->hwm += LINK_SIZE;
6086                  }                  }
6087                save_hwm_offset = this_hwm_offset;                base_hwm_offset = this_hwm_offset;
6088                code += len;                code += len;
6089                }                }
6090              }              }
# Line 6151  for (;; ptr++) Line 6152  for (;; ptr++)
6152    
6153            while (cd->hwm > cd->start_workspace + cd->workspace_size -            while (cd->hwm > cd->start_workspace + cd->workspace_size -
6154                   WORK_SIZE_SAFETY_MARGIN -                   WORK_SIZE_SAFETY_MARGIN -
6155                   (this_hwm_offset - save_hwm_offset))                   (this_hwm_offset - base_hwm_offset))
6156              {              {
6157              *errorcodeptr = expand_workspace(cd);              *errorcodeptr = expand_workspace(cd);
6158              if (*errorcodeptr != 0) goto FAILED;              if (*errorcodeptr != 0) goto FAILED;
6159              }              }
6160    
6161            for (hc = (pcre_uchar *)cd->start_workspace + save_hwm_offset;            for (hc = (pcre_uchar *)cd->start_workspace + base_hwm_offset;
6162                 hc < (pcre_uchar *)cd->start_workspace + this_hwm_offset;                 hc < (pcre_uchar *)cd->start_workspace + this_hwm_offset;
6163                 hc += LINK_SIZE)                 hc += LINK_SIZE)
6164              {              {
6165              PUT(cd->hwm, 0, GET(hc, 0) + len + ((i != 0)? 2+LINK_SIZE : 1));              PUT(cd->hwm, 0, GET(hc, 0) + len + ((i != 0)? 2+LINK_SIZE : 1));
6166              cd->hwm += LINK_SIZE;              cd->hwm += LINK_SIZE;
6167              }              }
6168            save_hwm_offset = this_hwm_offset;            base_hwm_offset = this_hwm_offset;
6169            code += len;            code += len;
6170            }            }
6171    
# Line 6476  for (;; ptr++) Line 6477  for (;; ptr++)
6477    
6478      /* First deal with comments. Putting this code right at the start ensures      /* First deal with comments. Putting this code right at the start ensures
6479      that comments have no bad side effects. */      that comments have no bad side effects. */
6480    
6481      if (ptr[0] == CHAR_QUESTION_MARK && ptr[1] == CHAR_NUMBER_SIGN)      if (ptr[0] == CHAR_QUESTION_MARK && ptr[1] == CHAR_NUMBER_SIGN)
6482        {        {
6483        ptr += 2;        ptr += 2;
6484        while (*ptr != CHAR_NULL && *ptr != CHAR_RIGHT_PARENTHESIS) ptr++;        while (*ptr != CHAR_NULL && *ptr != CHAR_RIGHT_PARENTHESIS) ptr++;
6485        if (*ptr == CHAR_NULL)        if (*ptr == CHAR_NULL)
6486          {          {
6487          *errorcodeptr = ERR18;          *errorcodeptr = ERR18;
6488          goto FAILED;          goto FAILED;
6489          }          }
6490        continue;        continue;
6491        }        }
6492    
6493      /* Now deal with various "verbs" that can be introduced by '*'. */      /* Now deal with various "verbs" that can be introduced by '*'. */
6494    
# Line 6679  for (;; ptr++) Line 6680  for (;; ptr++)
6680          if (tempptr[1] == CHAR_QUESTION_MARK &&          if (tempptr[1] == CHAR_QUESTION_MARK &&
6681                (tempptr[2] == CHAR_EQUALS_SIGN ||                (tempptr[2] == CHAR_EQUALS_SIGN ||
6682                 tempptr[2] == CHAR_EXCLAMATION_MARK ||                 tempptr[2] == CHAR_EXCLAMATION_MARK ||
6683                 tempptr[2] == CHAR_LESS_THAN_SIGN))                   (tempptr[2] == CHAR_LESS_THAN_SIGN &&
6684                       (tempptr[3] == CHAR_EQUALS_SIGN ||
6685                        tempptr[3] == CHAR_EXCLAMATION_MARK))))
6686            {            {
6687            cd->iscondassert = TRUE;            cd->iscondassert = TRUE;
6688            break;            break;

Legend:
Removed from v.1538  
changed lines
  Added in v.1540

  ViewVC Help
Powered by ViewVC 1.1.5