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

Diff of /code/trunk/pcre_dfa_exec.c

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

revision 392 by ph10, Tue Mar 17 21:30:30 2009 UTC revision 397 by ph10, Fri Mar 20 19:40:08 2009 UTC
# Line 512  for (;;) Line 512  for (;;)
512      stateblock *current_state = active_states + i;      stateblock *current_state = active_states + i;
513      const uschar *code;      const uschar *code;
514      int state_offset = current_state->offset;      int state_offset = current_state->offset;
515      int count, codevalue;      int count, codevalue, rrc;
516    
517  #ifdef DEBUG  #ifdef DEBUG
518      printf ("%.*sProcessing state %d c=", rlevel*2-2, SP, state_offset);      printf ("%.*sProcessing state %d c=", rlevel*2-2, SP, state_offset);
# Line 2201  for (;;) Line 2201  for (;;)
2201          {          {
2202          int local_offsets[1000];          int local_offsets[1000];
2203          int local_workspace[1000];          int local_workspace[1000];
2204          int condcode = code[LINK_SIZE+1];          int codelink = GET(code, 1);
2205            int condcode;
2206    
2207            /* Because of the way auto-callout works during compile, a callout item
2208            is inserted between OP_COND and an assertion condition. */
2209    
2210            if (code[LINK_SIZE+1] == OP_CALLOUT)
2211              {
2212              if (pcre_callout != NULL)
2213                {
2214                int rrc;
2215                pcre_callout_block cb;
2216                cb.version          = 1;   /* Version 1 of the callout block */
2217                cb.callout_number   = code[LINK_SIZE+2];
2218                cb.offset_vector    = offsets;
2219                cb.subject          = (PCRE_SPTR)start_subject;
2220                cb.subject_length   = end_subject - start_subject;
2221                cb.start_match      = current_subject - start_subject;
2222                cb.current_position = ptr - start_subject;
2223                cb.pattern_position = GET(code, LINK_SIZE + 3);
2224                cb.next_item_length = GET(code, 3 + 2*LINK_SIZE);
2225                cb.capture_top      = 1;
2226                cb.capture_last     = -1;
2227                cb.callout_data     = md->callout_data;
2228                if ((rrc = (*pcre_callout)(&cb)) < 0) return rrc;   /* Abandon */
2229                if (rrc == 0) { ADD_ACTIVE(state_offset + _pcre_OP_lengths[OP_CALLOUT], 0); }
2230                }
2231              code += _pcre_OP_lengths[OP_CALLOUT];
2232              }
2233    
2234            condcode = code[LINK_SIZE+1];
2235    
2236          /* Back reference conditions are not supported */          /* Back reference conditions are not supported */
2237    
2238          if (condcode == OP_CREF) return PCRE_ERROR_DFA_UCOND;          if (condcode == OP_CREF) return PCRE_ERROR_DFA_UCOND;
# Line 2211  for (;;) Line 2241  for (;;)
2241    
2242          if (condcode == OP_DEF)          if (condcode == OP_DEF)
2243            {            {
2244            ADD_ACTIVE(state_offset + GET(code, 1) + LINK_SIZE + 1, 0);            ADD_ACTIVE(state_offset + codelink + LINK_SIZE + 1, 0);
2245            }            }
2246    
2247          /* The only supported version of OP_RREF is for the value RREF_ANY,          /* The only supported version of OP_RREF is for the value RREF_ANY,
# Line 2223  for (;;) Line 2253  for (;;)
2253            int value = GET2(code, LINK_SIZE+2);            int value = GET2(code, LINK_SIZE+2);
2254            if (value != RREF_ANY) return PCRE_ERROR_DFA_UCOND;            if (value != RREF_ANY) return PCRE_ERROR_DFA_UCOND;
2255            if (recursing > 0) { ADD_ACTIVE(state_offset + LINK_SIZE + 4, 0); }            if (recursing > 0) { ADD_ACTIVE(state_offset + LINK_SIZE + 4, 0); }
2256              else { ADD_ACTIVE(state_offset + GET(code, 1) + LINK_SIZE + 1, 0); }              else { ADD_ACTIVE(state_offset + codelink + LINK_SIZE + 1, 0); }
2257            }            }
2258    
2259          /* Otherwise, the condition is an assertion */          /* Otherwise, the condition is an assertion */
# Line 2251  for (;;) Line 2281  for (;;)
2281    
2282            if ((rc >= 0) ==            if ((rc >= 0) ==
2283                  (condcode == OP_ASSERT || condcode == OP_ASSERTBACK))                  (condcode == OP_ASSERT || condcode == OP_ASSERTBACK))
2284              { ADD_ACTIVE(endasscode + LINK_SIZE + 1 - start_code, 0); }              {
2285                ADD_ACTIVE(endasscode + LINK_SIZE + 1 - start_code, 0);
2286                }
2287            else            else
2288              { ADD_ACTIVE(state_offset + GET(code, 1) + LINK_SIZE + 1, 0); }              { ADD_ACTIVE(state_offset + codelink + LINK_SIZE + 1, 0); }
2289            }            }
2290          }          }
2291        break;        break;
# Line 2405  for (;;) Line 2437  for (;;)
2437        /* Handle callouts */        /* Handle callouts */
2438    
2439        case OP_CALLOUT:        case OP_CALLOUT:
2440          rrc = 0;
2441        if (pcre_callout != NULL)        if (pcre_callout != NULL)
2442          {          {
         int rrc;  
2443          pcre_callout_block cb;          pcre_callout_block cb;
2444          cb.version          = 1;   /* Version 1 of the callout block */          cb.version          = 1;   /* Version 1 of the callout block */
2445          cb.callout_number   = code[1];          cb.callout_number   = code[1];
# Line 2422  for (;;) Line 2454  for (;;)
2454          cb.capture_last     = -1;          cb.capture_last     = -1;
2455          cb.callout_data     = md->callout_data;          cb.callout_data     = md->callout_data;
2456          if ((rrc = (*pcre_callout)(&cb)) < 0) return rrc;   /* Abandon */          if ((rrc = (*pcre_callout)(&cb)) < 0) return rrc;   /* Abandon */
2457          if (rrc == 0) { ADD_ACTIVE(state_offset + 2 + 2*LINK_SIZE, 0); }          }
2458          }        if (rrc == 0)
2459            { ADD_ACTIVE(state_offset + _pcre_OP_lengths[OP_CALLOUT], 0); }
2460        break;        break;
2461    
2462    

Legend:
Removed from v.392  
changed lines
  Added in v.397

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12