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

Diff of /code/trunk/pcre_jit_compile.c

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

revision 1084 by chpe, Tue Oct 16 15:55:28 2012 UTC revision 1187 by zherczeg, Mon Oct 29 11:30:45 2012 UTC
# Line 170  typedef struct executable_functions { Line 170  typedef struct executable_functions {
170    void *executable_funcs[JIT_NUMBER_OF_COMPILE_MODES];    void *executable_funcs[JIT_NUMBER_OF_COMPILE_MODES];
171    PUBL(jit_callback) callback;    PUBL(jit_callback) callback;
172    void *userdata;    void *userdata;
173      pcre_uint32 top_bracket;
174    sljit_uw executable_sizes[JIT_NUMBER_OF_COMPILE_MODES];    sljit_uw executable_sizes[JIT_NUMBER_OF_COMPILE_MODES];
175  } executable_functions;  } executable_functions;
176    
# Line 591  switch(*cc) Line 592  switch(*cc)
592    case OP_NOTPOSPLUSI:    case OP_NOTPOSPLUSI:
593    case OP_NOTPOSQUERYI:    case OP_NOTPOSQUERYI:
594    cc += 2;    cc += 2;
595  #if defined SUPPORT_UTF && !defined COMPILE_PCRE32  #ifdef SUPPORT_UTF
596    if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);    if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);
597  #endif  #endif
598    return cc;    return cc;
# Line 613  switch(*cc) Line 614  switch(*cc)
614    case OP_NOTEXACTI:    case OP_NOTEXACTI:
615    case OP_NOTPOSUPTOI:    case OP_NOTPOSUPTOI:
616    cc += 2 + IMM2_SIZE;    cc += 2 + IMM2_SIZE;
617  #if defined SUPPORT_UTF && !defined COMPILE_PCRE32  #ifdef SUPPORT_UTF
618    if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);    if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);
619  #endif  #endif
620    return cc;    return cc;
# Line 767  int private_data_length = 0; Line 768  int private_data_length = 0;
768  pcre_uchar *alternative;  pcre_uchar *alternative;
769  pcre_uchar *name;  pcre_uchar *name;
770  pcre_uchar *end = NULL;  pcre_uchar *end = NULL;
771  int space, size, bracketlen, i;  int space, size, i;
772    pcre_uint32 bracketlen;
773    
774  /* Calculate important variables (like stack size) and checks whether all opcodes are supported. */  /* Calculate important variables (like stack size) and checks whether all opcodes are supported. */
775  while (cc < ccend)  while (cc < ccend)
# Line 936  while (cc < ccend) Line 938  while (cc < ccend)
938      if (size < 0)      if (size < 0)
939        {        {
940        cc += -size;        cc += -size;
941  #if defined SUPPORT_UTF && !defined COMPILE_PCRE32  #ifdef SUPPORT_UTF
942        if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);        if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);
943  #endif  #endif
944        }        }
# Line 944  while (cc < ccend) Line 946  while (cc < ccend)
946        cc += size;        cc += size;
947      }      }
948    
949    if (bracketlen > 0)    if (bracketlen != 0)
950      {      {
951      if (cc >= end)      if (cc >= end)
952        {        {
# Line 1076  while (cc < ccend) Line 1078  while (cc < ccend)
1078      if (size < 0)      if (size < 0)
1079        {        {
1080        cc += -size;        cc += -size;
1081  #if defined SUPPORT_UTF && !defined COMPILE_PCRE32  #ifdef SUPPORT_UTF
1082        if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);        if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);
1083  #endif  #endif
1084        }        }
# Line 1320  while (cc < ccend) Line 1322  while (cc < ccend)
1322      if (PRIVATE_DATA(cc))      if (PRIVATE_DATA(cc))
1323        private_data_length++;        private_data_length++;
1324      cc += 2;      cc += 2;
1325  #if defined SUPPORT_UTF && !defined COMPILE_PCRE32  #ifdef SUPPORT_UTF
1326      if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);      if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);
1327  #endif  #endif
1328      break;      break;
# Line 1329  while (cc < ccend) Line 1331  while (cc < ccend)
1331      if (PRIVATE_DATA(cc))      if (PRIVATE_DATA(cc))
1332        private_data_length += 2;        private_data_length += 2;
1333      cc += 2;      cc += 2;
1334  #if defined SUPPORT_UTF && !defined COMPILE_PCRE32  #ifdef SUPPORT_UTF
1335      if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);      if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);
1336  #endif  #endif
1337      break;      break;
# Line 1338  while (cc < ccend) Line 1340  while (cc < ccend)
1340      if (PRIVATE_DATA(cc))      if (PRIVATE_DATA(cc))
1341        private_data_length += 2;        private_data_length += 2;
1342      cc += 2 + IMM2_SIZE;      cc += 2 + IMM2_SIZE;
1343  #if defined SUPPORT_UTF && !defined COMPILE_PCRE32  #ifdef SUPPORT_UTF
1344      if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);      if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);
1345  #endif  #endif
1346      break;      break;
# Line 1497  while (status != end) Line 1499  while (status != end)
1499          srcw[0] = PRIVATE_DATA(cc);          srcw[0] = PRIVATE_DATA(cc);
1500          }          }
1501        cc += 2;        cc += 2;
1502  #if defined SUPPORT_UTF && !defined COMPILE_PCRE32  #ifdef SUPPORT_UTF
1503        if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);        if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);
1504  #endif  #endif
1505        break;        break;
# Line 1510  while (status != end) Line 1512  while (status != end)
1512          srcw[1] = PRIVATE_DATA(cc) + sizeof(sljit_w);          srcw[1] = PRIVATE_DATA(cc) + sizeof(sljit_w);
1513          }          }
1514        cc += 2;        cc += 2;
1515  #if defined SUPPORT_UTF && !defined COMPILE_PCRE32  #ifdef SUPPORT_UTF
1516        if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);        if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);
1517  #endif  #endif
1518        break;        break;
# Line 1523  while (status != end) Line 1525  while (status != end)
1525          srcw[1] = PRIVATE_DATA(cc) + sizeof(sljit_w);          srcw[1] = PRIVATE_DATA(cc) + sizeof(sljit_w);
1526          }          }
1527        cc += 2 + IMM2_SIZE;        cc += 2 + IMM2_SIZE;
1528  #if defined SUPPORT_UTF && !defined COMPILE_PCRE32  #ifdef SUPPORT_UTF
1529        if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);        if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);
1530  #endif  #endif
1531        break;        break;
# Line 2452  struct sljit_label *newlinelabel = NULL; Line 2454  struct sljit_label *newlinelabel = NULL;
2454  struct sljit_jump *start;  struct sljit_jump *start;
2455  struct sljit_jump *end = NULL;  struct sljit_jump *end = NULL;
2456  struct sljit_jump *nl = NULL;  struct sljit_jump *nl = NULL;
2457  #ifdef SUPPORT_UTF  #if defined SUPPORT_UTF && !defined COMPILE_PCRE32
2458  struct sljit_jump *singlechar;  struct sljit_jump *singlechar;
2459  #endif  #endif
2460  jump_list *newline = NULL;  jump_list *newline = NULL;
# Line 2643  while (TRUE) Line 2645  while (TRUE)
2645        break;        break;
2646    
2647    len = 1;    len = 1;
2648  #if defined SUPPORT_UTF && !defined COMPILE_PCRE32  #ifdef SUPPORT_UTF
2649    if (common->utf && HAS_EXTRALEN(cc[0])) len += GET_EXTRALEN(cc[0]);    if (common->utf && HAS_EXTRALEN(cc[0])) len += GET_EXTRALEN(cc[0]);
2650  #endif  #endif
2651    
# Line 3529  if (caseless && char_has_othercase(commo Line 3531  if (caseless && char_has_othercase(commo
3531    othercasechar = cc + (othercasebit >> 8);    othercasechar = cc + (othercasebit >> 8);
3532    othercasebit &= 0xff;    othercasebit &= 0xff;
3533  #elif defined COMPILE_PCRE16 || defined COMPILE_PCRE32  #elif defined COMPILE_PCRE16 || defined COMPILE_PCRE32
3534      /* Note that this code only handles characters in the BMP. If there
3535      ever are characters outside the BMP whose othercase differs in only one
3536      bit from itself (there currently are none), this code will need to be
3537      revised for COMPILE_PCRE32. */
3538    othercasechar = cc + (othercasebit >> 9);    othercasechar = cc + (othercasebit >> 9);
3539    if ((othercasebit & 0x100) != 0)    if ((othercasebit & 0x100) != 0)
3540      othercasebit = (othercasebit & 0xff) << 8;      othercasebit = (othercasebit & 0xff) << 8;
# Line 3563  if (context->sourcereg == -1) Line 3569  if (context->sourcereg == -1)
3569    
3570  #ifdef SUPPORT_UTF  #ifdef SUPPORT_UTF
3571  utflength = 1;  utflength = 1;
 #ifndef COMPILE_PCRE32  
3572  if (common->utf && HAS_EXTRALEN(*cc))  if (common->utf && HAS_EXTRALEN(*cc))
3573    utflength += GET_EXTRALEN(*cc);    utflength += GET_EXTRALEN(*cc);
 #endif  
3574    
3575  do  do
3576    {    {
# Line 3759  while (*cc != XCL_END) Line 3763  while (*cc != XCL_END)
3763    if (*cc == XCL_SINGLE)    if (*cc == XCL_SINGLE)
3764      {      {
3765      cc += 2;      cc += 2;
3766  #if defined SUPPORT_UTF && !defined COMPILE_PCRE32  #ifdef SUPPORT_UTF
3767      if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);      if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);
3768  #endif  #endif
3769  #ifdef SUPPORT_UCP  #ifdef SUPPORT_UCP
# Line 3769  while (*cc != XCL_END) Line 3773  while (*cc != XCL_END)
3773    else if (*cc == XCL_RANGE)    else if (*cc == XCL_RANGE)
3774      {      {
3775      cc += 2;      cc += 2;
3776  #if defined SUPPORT_UTF && !defined COMPILE_PCRE32  #ifdef SUPPORT_UTF
3777      if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);      if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);
3778  #endif  #endif
3779      cc++;      cc++;
3780  #if defined SUPPORT_UTF && !defined COMPILE_PCRE32  #ifdef SUPPORT_UTF
3781      if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);      if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);
3782  #endif  #endif
3783  #ifdef SUPPORT_UCP  #ifdef SUPPORT_UCP
# Line 4467  switch(type) Line 4471  switch(type)
4471    case OP_CHAR:    case OP_CHAR:
4472    case OP_CHARI:    case OP_CHARI:
4473    length = 1;    length = 1;
4474  #if defined SUPPORT_UTF && !defined COMPILE_PCRE32  #ifdef SUPPORT_UTF
4475    if (common->utf && HAS_EXTRALEN(*cc)) length += GET_EXTRALEN(*cc);    if (common->utf && HAS_EXTRALEN(*cc)) length += GET_EXTRALEN(*cc);
4476  #endif  #endif
4477    if (common->mode == JIT_COMPILE && (type == OP_CHAR || !char_has_othercase(common, cc) || char_get_othercase_bit(common, cc) != 0))    if (common->mode == JIT_COMPILE && (type == OP_CHAR || !char_has_othercase(common, cc) || char_get_othercase_bit(common, cc) != 0))
# Line 4662  do Line 4666  do
4666    if (*cc == OP_CHAR)    if (*cc == OP_CHAR)
4667      {      {
4668      size = 1;      size = 1;
4669  #if defined SUPPORT_UTF && !defined COMPILE_PCRE32  #ifdef SUPPORT_UTF
4670      if (common->utf && HAS_EXTRALEN(cc[1]))      if (common->utf && HAS_EXTRALEN(cc[1]))
4671        size += GET_EXTRALEN(cc[1]);        size += GET_EXTRALEN(cc[1]);
4672  #endif  #endif
# Line 4675  do Line 4679  do
4679        {        {
4680        if (char_has_othercase(common, cc + 1) && char_get_othercase_bit(common, cc + 1) == 0)        if (char_has_othercase(common, cc + 1) && char_get_othercase_bit(common, cc + 1) == 0)
4681          size = 0;          size = 0;
 #ifndef COMPILE_PCRE32  
4682        else if (HAS_EXTRALEN(cc[1]))        else if (HAS_EXTRALEN(cc[1]))
4683          size += GET_EXTRALEN(cc[1]);          size += GET_EXTRALEN(cc[1]);
 #endif  
4684        }        }
4685      else      else
4686  #endif  #endif
# Line 5331  common->accept = save_accept; Line 5333  common->accept = save_accept;
5333  return cc + 1 + LINK_SIZE;  return cc + 1 + LINK_SIZE;
5334  }  }
5335    
5336  static sljit_w SLJIT_CALL do_searchovector(sljit_w refno, sljit_w* locals, pcre_uchar *name_table)  static sljit_w SLJIT_CALL do_searchovector(sljit_uw refno, sljit_w* locals, pcre_uchar *name_table)
5337  {  {
5338  int condition = FALSE;  int condition = FALSE;
5339  pcre_uchar *slotA = name_table;  pcre_uchar *slotA = name_table;
# Line 5388  if (i < name_count) Line 5390  if (i < name_count)
5390  return condition;  return condition;
5391  }  }
5392    
5393  static sljit_w SLJIT_CALL do_searchgroups(sljit_w recno, sljit_w* locals, pcre_uchar *name_table)  static sljit_w SLJIT_CALL do_searchgroups(sljit_uw recno, sljit_uw* locals, pcre_uchar *name_table)
5394  {  {
5395  int condition = FALSE;  int condition = FALSE;
5396  pcre_uchar *slotA = name_table;  pcre_uchar *slotA = name_table;
5397  pcre_uchar *slotB;  pcre_uchar *slotB;
5398  sljit_w name_count = locals[LOCALS0 / sizeof(sljit_w)];  sljit_uw name_count = locals[LOCALS0 / sizeof(sljit_w)];
5399  sljit_w name_entry_size = locals[LOCALS1 / sizeof(sljit_w)];  sljit_uw name_entry_size = locals[LOCALS1 / sizeof(sljit_w)];
5400  sljit_w group_num = locals[POSSESSIVE0 / sizeof(sljit_w)];  sljit_uw group_num = locals[POSSESSIVE0 / sizeof(sljit_w)];
5401  int i;  sljit_uw i;
5402    
5403  for (i = 0; i < name_count; i++)  for (i = 0; i < name_count; i++)
5404    {    {
# Line 5551  if (SLJIT_UNLIKELY(opcode == OP_COND) || Line 5553  if (SLJIT_UNLIKELY(opcode == OP_COND) ||
5553      else if (common->currententry->start == 0)      else if (common->currententry->start == 0)
5554        has_alternatives = stacksize != 0;        has_alternatives = stacksize != 0;
5555      else      else
5556        has_alternatives = stacksize != GET2(common->start, common->currententry->start + 1 + LINK_SIZE);        has_alternatives = stacksize != (int)GET2(common->start, common->currententry->start + 1 + LINK_SIZE);
5557      }      }
5558    }    }
5559    
# Line 5786  if (opcode == OP_COND || opcode == OP_SC Line 5788  if (opcode == OP_COND || opcode == OP_SC
5788      else if (common->currententry->start == 0)      else if (common->currententry->start == 0)
5789        stacksize = stacksize == 0;        stacksize = stacksize == 0;
5790      else      else
5791        stacksize = stacksize == GET2(common->start, common->currententry->start + 1 + LINK_SIZE);        stacksize = stacksize == (int)GET2(common->start, common->currententry->start + 1 + LINK_SIZE);
5792    
5793      if (*matchingpath == OP_RREF || stacksize || common->currententry == NULL)      if (*matchingpath == OP_RREF || stacksize || common->currententry == NULL)
5794        {        {
# Line 6266  if (*type == 0) Line 6268  if (*type == 0)
6268  if (end != NULL)  if (end != NULL)
6269    {    {
6270    *end = cc + 1;    *end = cc + 1;
6271  #if defined SUPPORT_UTF && !defined COMPILE_PCRE32  #ifdef SUPPORT_UTF
6272    if (common->utf && HAS_EXTRALEN(*cc)) *end += GET_EXTRALEN(*cc);    if (common->utf && HAS_EXTRALEN(*cc)) *end += GET_EXTRALEN(*cc);
6273  #endif  #endif
6274    }    }
# Line 8241  else Line 8243  else
8243      return;      return;
8244      }      }
8245    memset(functions, 0, sizeof(executable_functions));    memset(functions, 0, sizeof(executable_functions));
8246      functions->top_bracket = (re->top_bracket + 1) * 2;
8247    extra->executable_jit = functions;    extra->executable_jit = functions;
8248    extra->flags |= PCRE_EXTRA_EXECUTABLE_JIT;    extra->flags |= PCRE_EXTRA_EXECUTABLE_JIT;
8249    }    }
# Line 8268  return convert_executable_func.call_exec Line 8271  return convert_executable_func.call_exec
8271  }  }
8272    
8273  int  int
8274  PRIV(jit_exec)(const REAL_PCRE *re, const PUBL(extra) *extra_data, const pcre_uchar *subject,  PRIV(jit_exec)(const PUBL(extra) *extra_data, const pcre_uchar *subject,
8275    int length, int start_offset, int options, int *offsets, int offsetcount)    int length, int start_offset, int options, int *offsets, int offsetcount)
8276  {  {
8277  executable_functions *functions = (executable_functions *)extra_data->executable_jit;  executable_functions *functions = (executable_functions *)extra_data->executable_jit;
# Line 8287  else if ((options & PCRE_PARTIAL_SOFT) ! Line 8290  else if ((options & PCRE_PARTIAL_SOFT) !
8290    mode = JIT_PARTIAL_SOFT_COMPILE;    mode = JIT_PARTIAL_SOFT_COMPILE;
8291    
8292  if (functions->executable_funcs[mode] == NULL)  if (functions->executable_funcs[mode] == NULL)
8293    return PCRE_ERROR_NULL;    return PCRE_ERROR_JIT_BADOPTION;
8294    
8295  /* Sanity checks should be handled by pcre_exec. */  /* Sanity checks should be handled by pcre_exec. */
 arguments.stack = NULL;  
8296  arguments.str = subject + start_offset;  arguments.str = subject + start_offset;
8297  arguments.begin = subject;  arguments.begin = subject;
8298  arguments.end = subject + length;  arguments.end = subject + length;
# Line 8311  gets the same result with and without JI Line 8313  gets the same result with and without JI
8313    
8314  if (offsetcount != 2)  if (offsetcount != 2)
8315    offsetcount = ((offsetcount - (offsetcount % 3)) * 2) / 3;    offsetcount = ((offsetcount - (offsetcount % 3)) * 2) / 3;
8316  maxoffsetcount = (re->top_bracket + 1) * 2;  maxoffsetcount = functions->top_bracket;
8317  if (offsetcount > maxoffsetcount)  if (offsetcount > maxoffsetcount)
8318    offsetcount = maxoffsetcount;    offsetcount = maxoffsetcount;
8319  arguments.offsetcount = offsetcount;  arguments.offsetcount = offsetcount;
# Line 8331  else Line 8333  else
8333    
8334  if (retval * 2 > offsetcount)  if (retval * 2 > offsetcount)
8335    retval = 0;    retval = 0;
8336    if ((extra_data->flags & PCRE_EXTRA_MARK) != 0)
8337      *(extra_data->mark) = arguments.mark_ptr;
8338    
8339    return retval;
8340    }
8341    
8342    #if defined COMPILE_PCRE8
8343    PCRE_EXP_DEFN int PCRE_CALL_CONVENTION
8344    pcre_jit_exec(const pcre *argument_re, const pcre_extra *extra_data,
8345      PCRE_SPTR subject, int length, int start_offset, int options,
8346      int *offsets, int offsetcount, pcre_jit_stack *stack)
8347    #elif defined COMPILE_PCRE16
8348    PCRE_EXP_DEFN int PCRE_CALL_CONVENTION
8349    pcre16_jit_exec(const pcre16 *argument_re, const pcre16_extra *extra_data,
8350      PCRE_SPTR16 subject, int length, int start_offset, int options,
8351      int *offsets, int offsetcount, pcre16_jit_stack *stack)
8352    #elif defined COMPILE_PCRE32
8353    PCRE_EXP_DEFN int PCRE_CALL_CONVENTION
8354    pcre32_jit_exec(const pcre32 *argument_re, const pcre32_extra *extra_data,
8355      PCRE_SPTR32 subject, int length, int start_offset, int options,
8356      int *offsets, int offsetcount, pcre32_jit_stack *stack)
8357    #endif
8358    {
8359    pcre_uchar *subject_ptr = (pcre_uchar *)subject;
8360    executable_functions *functions = (executable_functions *)extra_data->executable_jit;
8361    union {
8362       void* executable_func;
8363       jit_function call_executable_func;
8364    } convert_executable_func;
8365    jit_arguments arguments;
8366    int maxoffsetcount;
8367    int retval;
8368    int mode = JIT_COMPILE;
8369    
8370    SLJIT_UNUSED_ARG(argument_re);
8371    
8372    /* Plausibility checks */
8373    if ((options & ~PUBLIC_JIT_EXEC_OPTIONS) != 0) return PCRE_ERROR_JIT_BADOPTION;
8374    
8375    if ((options & PCRE_PARTIAL_HARD) != 0)
8376      mode = JIT_PARTIAL_HARD_COMPILE;
8377    else if ((options & PCRE_PARTIAL_SOFT) != 0)
8378      mode = JIT_PARTIAL_SOFT_COMPILE;
8379    
8380    if (functions->executable_funcs[mode] == NULL)
8381      return PCRE_ERROR_JIT_BADOPTION;
8382    
8383    /* Sanity checks should be handled by pcre_exec. */
8384    arguments.stack = (struct sljit_stack *)stack;
8385    arguments.str = subject_ptr + start_offset;
8386    arguments.begin = subject_ptr;
8387    arguments.end = subject_ptr + length;
8388    arguments.mark_ptr = NULL;
8389    /* JIT decreases this value less frequently than the interpreter. */
8390    arguments.calllimit = ((extra_data->flags & PCRE_EXTRA_MATCH_LIMIT) == 0) ? MATCH_LIMIT : extra_data->match_limit;
8391    arguments.notbol = (options & PCRE_NOTBOL) != 0;
8392    arguments.noteol = (options & PCRE_NOTEOL) != 0;
8393    arguments.notempty = (options & PCRE_NOTEMPTY) != 0;
8394    arguments.notempty_atstart = (options & PCRE_NOTEMPTY_ATSTART) != 0;
8395    arguments.offsets = offsets;
8396    
8397    /* pcre_exec() rounds offsetcount to a multiple of 3, and then uses only 2/3 of
8398    the output vector for storing captured strings, with the remainder used as
8399    workspace. We don't need the workspace here. For compatibility, we limit the
8400    number of captured strings in the same way as pcre_exec(), so that the user
8401    gets the same result with and without JIT. */
8402    
8403    if (offsetcount != 2)
8404      offsetcount = ((offsetcount - (offsetcount % 3)) * 2) / 3;
8405    maxoffsetcount = functions->top_bracket;
8406    if (offsetcount > maxoffsetcount)
8407      offsetcount = maxoffsetcount;
8408    arguments.offsetcount = offsetcount;
8409    
8410    convert_executable_func.executable_func = functions->executable_funcs[mode];
8411    retval = convert_executable_func.call_executable_func(&arguments);
8412    
8413    if (retval * 2 > offsetcount)
8414      retval = 0;
8415  if ((extra_data->flags & PCRE_EXTRA_MARK) != 0)  if ((extra_data->flags & PCRE_EXTRA_MARK) != 0)
8416    *(extra_data->mark) = arguments.mark_ptr;    *(extra_data->mark) = arguments.mark_ptr;
8417    

Legend:
Removed from v.1084  
changed lines
  Added in v.1187

  ViewVC Help
Powered by ViewVC 1.1.5