/[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 1312 by ph10, Tue Apr 23 09:48:25 2013 UTC revision 1313 by ph10, Wed Apr 24 12:07:09 2013 UTC
# Line 6511  if (extra_data != NULL Line 6511  if (extra_data != NULL
6511      && extra_data->executable_jit != NULL      && extra_data->executable_jit != NULL
6512      && (options & ~PUBLIC_JIT_EXEC_OPTIONS) == 0)      && (options & ~PUBLIC_JIT_EXEC_OPTIONS) == 0)
6513    {    {
6514      /* A facility for setting the match limit in the regex was added; this puts
6515      a value in the compiled block. (Similarly for recursion limit, but the JIT
6516      does not make use of that.) Because the regex is not passed to jit_exec, we
6517      fudge up an alternative extra block, because we must not modify the extra
6518      block that the user has passed. */
6519    
6520    #if defined COMPILE_PCRE8
6521      pcre_extra extra_data_copy;
6522    #elif defined COMPILE_PCRE16
6523      pcre16_extra extra_data_copy;
6524    #elif defined COMPILE_PCRE32
6525      pcre32_extra extra_data_copy;
6526    #endif
6527    
6528      if ((re->flags & PCRE_MLSET) != 0 &&
6529          ((extra_data->flags & PCRE_EXTRA_MATCH_LIMIT) == 0 ||
6530           re->limit_match < extra_data->match_limit))
6531        {
6532        extra_data_copy = *extra_data;
6533        extra_data_copy.match_limit = re->limit_match;
6534        extra_data_copy.flags |= PCRE_EXTRA_MATCH_LIMIT;
6535        extra_data = &extra_data_copy;
6536        }
6537    
6538    rc = PRIV(jit_exec)(extra_data, (const pcre_uchar *)subject, length,    rc = PRIV(jit_exec)(extra_data, (const pcre_uchar *)subject, length,
6539         start_offset, options, offsets, offsetcount);         start_offset, options, offsets, offsetcount);
6540    
# Line 6540  md->callout_data = NULL; Line 6564  md->callout_data = NULL;
6564    
6565  tables = re->tables;  tables = re->tables;
6566    
6567    /* The two limit values override the defaults, whatever their value. */
6568    
6569  if (extra_data != NULL)  if (extra_data != NULL)
6570    {    {
6571    register unsigned int flags = extra_data->flags;    register unsigned int flags = extra_data->flags;
# Line 6554  if (extra_data != NULL) Line 6580  if (extra_data != NULL)
6580    if ((flags & PCRE_EXTRA_TABLES) != 0) tables = extra_data->tables;    if ((flags & PCRE_EXTRA_TABLES) != 0) tables = extra_data->tables;
6581    }    }
6582    
6583    /* Limits in the regex override only if they are smaller. */
6584    
6585    if ((re->flags & PCRE_MLSET) != 0 && re->limit_match < md->match_limit)
6586      md->match_limit = re->limit_match;
6587    
6588    if ((re->flags & PCRE_RLSET) != 0 &&
6589        re->limit_recursion < md->match_limit_recursion)
6590      md->match_limit_recursion = re->limit_recursion;
6591    
6592  /* If the exec call supplied NULL for tables, use the inbuilt ones. This  /* If the exec call supplied NULL for tables, use the inbuilt ones. This
6593  is a feature that makes it possible to save compiled regex and re-use them  is a feature that makes it possible to save compiled regex and re-use them
6594  in other programs later. */  in other programs later. */

Legend:
Removed from v.1312  
changed lines
  Added in v.1313

  ViewVC Help
Powered by ViewVC 1.1.5