/[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 269 by ph10, Fri Nov 16 16:22:24 2007 UTC revision 270 by ph10, Fri Nov 16 19:55:16 2007 UTC
# Line 4248  we set the flag only if there is a liter Line 4248  we set the flag only if there is a liter
4248              *errorcodeptr = ERR58;              *errorcodeptr = ERR58;
4249              goto FAILED;              goto FAILED;
4250              }              }
4251            if (refsign == '-')            recno = (refsign == '-')?
4252                cd->bracount - recno + 1 : recno +cd->bracount;
4253              if (recno <= 0 || recno > cd->final_bracount)
4254              {              {
4255              recno = cd->bracount - recno + 1;              *errorcodeptr = ERR15;
4256              if (recno <= 0)              goto FAILED;
               {  
               *errorcodeptr = ERR15;  
               goto FAILED;  
               }  
4257              }              }
           else recno += cd->bracount;  
4258            PUT2(code, 2+LINK_SIZE, recno);            PUT2(code, 2+LINK_SIZE, recno);
4259            break;            break;
4260            }            }
# Line 4329  we set the flag only if there is a liter Line 4326  we set the flag only if there is a liter
4326            skipbytes = 1;            skipbytes = 1;
4327            }            }
4328    
4329          /* Check for the "name" actually being a subpattern number. */          /* Check for the "name" actually being a subpattern number. We are
4330            in the second pass here, so final_bracount is set. */
4331    
4332          else if (recno > 0)          else if (recno > 0 && recno <= cd->final_bracount)
4333            {            {
4334            PUT2(code, 2+LINK_SIZE, recno);            PUT2(code, 2+LINK_SIZE, recno);
4335            }            }
# Line 5939  to compile parts of the pattern into; th Line 5937  to compile parts of the pattern into; th
5937  no longer needed, so hopefully this workspace will never overflow, though there  no longer needed, so hopefully this workspace will never overflow, though there
5938  is a test for its doing so. */  is a test for its doing so. */
5939    
5940  cd->bracount = 0;  cd->bracount = cd->final_bracount = 0;
5941  cd->names_found = 0;  cd->names_found = 0;
5942  cd->name_entry_size = 0;  cd->name_entry_size = 0;
5943  cd->name_table = NULL;  cd->name_table = NULL;
# Line 6016  field. Reset the bracket count and the n Line 6014  field. Reset the bracket count and the n
6014  field; this time it's used for remembering forward references to subpatterns.  field; this time it's used for remembering forward references to subpatterns.
6015  */  */
6016    
6017    cd->final_bracount = cd->bracount;  /* Save for checking forward references */
6018  cd->bracount = 0;  cd->bracount = 0;
6019  cd->names_found = 0;  cd->names_found = 0;
6020  cd->name_table = (uschar *)re + re->name_table_offset;  cd->name_table = (uschar *)re + re->name_table_offset;

Legend:
Removed from v.269  
changed lines
  Added in v.270

  ViewVC Help
Powered by ViewVC 1.1.5