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

Diff of /code/trunk/pcre_exec.c

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

revision 893 by ph10, Thu Jan 19 17:15:11 2012 UTC revision 901 by ph10, Sat Jan 21 15:47:59 2012 UTC
# Line 618  eptrblock newptrb; Line 618  eptrblock newptrb;
618    
619  /* There is a special fudge for calling match() in a way that causes it to  /* There is a special fudge for calling match() in a way that causes it to
620  measure the size of its basic stack frame when the stack is being used for  measure the size of its basic stack frame when the stack is being used for
621  recursion. The first argument (eptr) points to a pointer that is used  recursion. The second argument (ecode) being NULL triggers this behaviour. It
622  "statically" for doing the calculation. The second argument (ecode) being NULL  cannot normally ever be NULL. The return is the negated value of the frame
623  triggers this behaviour. It cannot normally every be NULL. The return is the  size. */
 negated value of the frame size. */  
624    
625  if (ecode == NULL)  if (ecode == NULL)
626    {    {
   char **aptr = (char **)eptr;  
627    if (rdepth == 0)    if (rdepth == 0)
628      {      return match((PCRE_PUCHAR)&rdepth, NULL, NULL, 0, NULL, NULL, 1);
     *aptr = (char *)&rdepth;  
     return match(eptr, NULL, NULL, 0, NULL, NULL, 1);  
     }  
629    else    else
630      {      {
631      int len = (char *)&rdepth - *aptr;      int len = (char *)&rdepth - (char *)eptr;
632      return (len > 0)? -len : len;      return (len > 0)? -len : len;
633      }      }
634    }    }
# Line 6215  const REAL_PCRE *re = (const REAL_PCRE * Line 6210  const REAL_PCRE *re = (const REAL_PCRE *
6210  /* Check for the special magic call that measures the size of the stack used  /* Check for the special magic call that measures the size of the stack used
6211  per recursive call of match(). */  per recursive call of match(). */
6212    
6213  if (re == NULL && extra_data == NULL && subject == NULL && length == -1)  if (re == NULL && extra_data == NULL && subject == NULL && length == -999 &&
6214        start_offset == -999)
6215  #ifdef NO_RECURSE  #ifdef NO_RECURSE
6216    return -sizeof(heapframe);    return -sizeof(heapframe);
6217  #else  #else
6218    return match((PCRE_PUCHAR)&start_partial, NULL, NULL, 0, NULL, NULL, 0);    return match(NULL, NULL, NULL, 0, NULL, NULL, 0);
6219  #endif  #endif
6220    
6221  /* Plausibility checks */  /* Plausibility checks */

Legend:
Removed from v.893  
changed lines
  Added in v.901

  ViewVC Help
Powered by ViewVC 1.1.5