/[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 518 by ph10, Tue May 18 15:47:01 2010 UTC revision 535 by ph10, Thu Jun 3 19:18:24 2010 UTC
# Line 475  if (*first_op == OP_REVERSE) Line 475  if (*first_op == OP_REVERSE)
475    
476      {      {
477      gone_back = (current_subject - max_back < start_subject)?      gone_back = (current_subject - max_back < start_subject)?
478        current_subject - start_subject : max_back;        (int)(current_subject - start_subject) : max_back;
479      current_subject -= gone_back;      current_subject -= gone_back;
480      }      }
481    
# Line 492  if (*first_op == OP_REVERSE) Line 492  if (*first_op == OP_REVERSE)
492      int back = GET(end_code, 2+LINK_SIZE);      int back = GET(end_code, 2+LINK_SIZE);
493      if (back <= gone_back)      if (back <= gone_back)
494        {        {
495        int bstate = end_code - start_code + 2 + 2*LINK_SIZE;        int bstate = (int)(end_code - start_code + 2 + 2*LINK_SIZE);
496        ADD_NEW_DATA(-bstate, 0, gone_back - back);        ADD_NEW_DATA(-bstate, 0, gone_back - back);
497        }        }
498      end_code += GET(end_code, 1);      end_code += GET(end_code, 1);
# Line 528  else Line 528  else
528        ((*this_start_code == OP_CBRA || *this_start_code == OP_SCBRA)? 2:0);        ((*this_start_code == OP_CBRA || *this_start_code == OP_SCBRA)? 2:0);
529      do      do
530        {        {
531        ADD_NEW(end_code - start_code + length, 0);        ADD_NEW((int)(end_code - start_code + length), 0);
532        end_code += GET(end_code, 1);        end_code += GET(end_code, 1);
533        length = 1 + LINK_SIZE;        length = 1 + LINK_SIZE;
534        }        }
# Line 755  for (;;) Line 755  for (;;)
755            if (count > 0) memmove(offsets + 2, offsets, count * sizeof(int));            if (count > 0) memmove(offsets + 2, offsets, count * sizeof(int));
756            if (offsetcount >= 2)            if (offsetcount >= 2)
757              {              {
758              offsets[0] = current_subject - start_subject;              offsets[0] = (int)(current_subject - start_subject);
759              offsets[1] = ptr - start_subject;              offsets[1] = (int)(ptr - start_subject);
760              DPRINTF(("%.*sSet matched string = \"%.*s\"\n", rlevel*2-2, SP,              DPRINTF(("%.*sSet matched string = \"%.*s\"\n", rlevel*2-2, SP,
761                offsets[1] - offsets[0], current_subject));                offsets[1] - offsets[0], current_subject));
762              }              }
# Line 778  for (;;) Line 778  for (;;)
778        /*-----------------------------------------------------------------*/        /*-----------------------------------------------------------------*/
779        case OP_ALT:        case OP_ALT:
780        do { code += GET(code, 1); } while (*code == OP_ALT);        do { code += GET(code, 1); } while (*code == OP_ALT);
781        ADD_ACTIVE(code - start_code, 0);        ADD_ACTIVE((int)(code - start_code), 0);
782        break;        break;
783    
784        /*-----------------------------------------------------------------*/        /*-----------------------------------------------------------------*/
# Line 786  for (;;) Line 786  for (;;)
786        case OP_SBRA:        case OP_SBRA:
787        do        do
788          {          {
789          ADD_ACTIVE(code - start_code + 1 + LINK_SIZE, 0);          ADD_ACTIVE((int)(code - start_code + 1 + LINK_SIZE), 0);
790          code += GET(code, 1);          code += GET(code, 1);
791          }          }
792        while (*code == OP_ALT);        while (*code == OP_ALT);
# Line 795  for (;;) Line 795  for (;;)
795        /*-----------------------------------------------------------------*/        /*-----------------------------------------------------------------*/
796        case OP_CBRA:        case OP_CBRA:
797        case OP_SCBRA:        case OP_SCBRA:
798        ADD_ACTIVE(code - start_code + 3 + LINK_SIZE,  0);        ADD_ACTIVE((int)(code - start_code + 3 + LINK_SIZE),  0);
799        code += GET(code, 1);        code += GET(code, 1);
800        while (*code == OP_ALT)        while (*code == OP_ALT)
801          {          {
802          ADD_ACTIVE(code - start_code + 1 + LINK_SIZE,  0);          ADD_ACTIVE((int)(code - start_code + 1 + LINK_SIZE),  0);
803          code += GET(code, 1);          code += GET(code, 1);
804          }          }
805        break;        break;
# Line 810  for (;;) Line 810  for (;;)
810        ADD_ACTIVE(state_offset + 1, 0);        ADD_ACTIVE(state_offset + 1, 0);
811        code += 1 + GET(code, 2);        code += 1 + GET(code, 2);
812        while (*code == OP_ALT) code += GET(code, 1);        while (*code == OP_ALT) code += GET(code, 1);
813        ADD_ACTIVE(code - start_code + 1 + LINK_SIZE, 0);        ADD_ACTIVE((int)(code - start_code + 1 + LINK_SIZE), 0);
814        break;        break;
815    
816        /*-----------------------------------------------------------------*/        /*-----------------------------------------------------------------*/
817        case OP_SKIPZERO:        case OP_SKIPZERO:
818        code += 1 + GET(code, 2);        code += 1 + GET(code, 2);
819        while (*code == OP_ALT) code += GET(code, 1);        while (*code == OP_ALT) code += GET(code, 1);
820        ADD_ACTIVE(code - start_code + 1 + LINK_SIZE, 0);        ADD_ACTIVE((int)(code - start_code + 1 + LINK_SIZE), 0);
821        break;        break;
822    
823        /*-----------------------------------------------------------------*/        /*-----------------------------------------------------------------*/
# Line 922  for (;;) Line 922  for (;;)
922            if (utf8) BACKCHAR(temp);            if (utf8) BACKCHAR(temp);
923  #endif  #endif
924            GETCHARTEST(d, temp);            GETCHARTEST(d, temp);
925  #ifdef SUPPORT_UCP  #ifdef SUPPORT_UCP
926            if ((md->poptions & PCRE_UCP) != 0)            if ((md->poptions & PCRE_UCP) != 0)
927              {              {
928              if (d == '_') left_word = TRUE; else              if (d == '_') left_word = TRUE; else
929                {                {
930                int cat = UCD_CATEGORY(d);                int cat = UCD_CATEGORY(d);
931                left_word = (cat == ucp_L || cat == ucp_N);                left_word = (cat == ucp_L || cat == ucp_N);
932                }                }
933              }              }
934            else            else
935  #endif  #endif
936            left_word = d < 256 && (ctypes[d] & ctype_word) != 0;            left_word = d < 256 && (ctypes[d] & ctype_word) != 0;
937            }            }
938          else left_word = FALSE;          else left_word = FALSE;
939    
940          if (clen > 0)          if (clen > 0)
941            {            {
942  #ifdef SUPPORT_UCP  #ifdef SUPPORT_UCP
943            if ((md->poptions & PCRE_UCP) != 0)            if ((md->poptions & PCRE_UCP) != 0)
944              {              {
945              if (c == '_') right_word = TRUE; else              if (c == '_') right_word = TRUE; else
946                {                {
947                int cat = UCD_CATEGORY(c);                int cat = UCD_CATEGORY(c);
948                right_word = (cat == ucp_L || cat == ucp_N);                right_word = (cat == ucp_L || cat == ucp_N);
949                }                }
950              }              }
951            else            else
952  #endif  #endif
953            right_word = c < 256 && (ctypes[c] & ctype_word) != 0;            right_word = c < 256 && (ctypes[c] & ctype_word) != 0;
954            }            }
955          else right_word = FALSE;          else right_word = FALSE;
956    
957          if ((left_word == right_word) == (codevalue == OP_NOT_WORD_BOUNDARY))          if ((left_word == right_word) == (codevalue == OP_NOT_WORD_BOUNDARY))
# Line 979  for (;;) Line 979  for (;;)
979            break;            break;
980    
981            case PT_LAMP:            case PT_LAMP:
982            OK = prop->chartype == ucp_Lu || prop->chartype == ucp_Ll ||            OK = prop->chartype == ucp_Lu || prop->chartype == ucp_Ll ||
983                 prop->chartype == ucp_Lt;                 prop->chartype == ucp_Lt;
984            break;            break;
985    
# Line 994  for (;;) Line 994  for (;;)
994            case PT_SC:            case PT_SC:
995            OK = prop->script == code[2];            OK = prop->script == code[2];
996            break;            break;
997    
998            /* These are specials for combination cases. */            /* These are specials for combination cases. */
999    
1000            case PT_ALNUM:            case PT_ALNUM:
1001            OK = _pcre_ucp_gentype[prop->chartype] == ucp_L ||            OK = _pcre_ucp_gentype[prop->chartype] == ucp_L ||
1002                 _pcre_ucp_gentype[prop->chartype] == ucp_N;                 _pcre_ucp_gentype[prop->chartype] == ucp_N;
1003            break;            break;
1004    
1005            case PT_SPACE:    /* Perl space */            case PT_SPACE:    /* Perl space */
1006            OK = _pcre_ucp_gentype[prop->chartype] == ucp_Z ||            OK = _pcre_ucp_gentype[prop->chartype] == ucp_Z ||
1007                 c == CHAR_HT || c == CHAR_NL || c == CHAR_FF || c == CHAR_CR;                 c == CHAR_HT || c == CHAR_NL || c == CHAR_FF || c == CHAR_CR;
1008            break;            break;
1009    
1010            case PT_PXSPACE:  /* POSIX space */            case PT_PXSPACE:  /* POSIX space */
1011            OK = _pcre_ucp_gentype[prop->chartype] == ucp_Z ||            OK = _pcre_ucp_gentype[prop->chartype] == ucp_Z ||
1012                 c == CHAR_HT || c == CHAR_NL || c == CHAR_VT ||                 c == CHAR_HT || c == CHAR_NL || c == CHAR_VT ||
1013                 c == CHAR_FF || c == CHAR_CR;                 c == CHAR_FF || c == CHAR_CR;
1014            break;            break;
1015    
1016            case PT_WORD:            case PT_WORD:
1017            OK = _pcre_ucp_gentype[prop->chartype] == ucp_L ||            OK = _pcre_ucp_gentype[prop->chartype] == ucp_L ||
1018                 _pcre_ucp_gentype[prop->chartype] == ucp_N ||                 _pcre_ucp_gentype[prop->chartype] == ucp_N ||
1019                 c == CHAR_UNDERSCORE;                 c == CHAR_UNDERSCORE;
1020            break;            break;
1021    
1022            /* Should never occur, but keep compilers from grumbling. */            /* Should never occur, but keep compilers from grumbling. */
1023    
# Line 1173  for (;;) Line 1173  for (;;)
1173            break;            break;
1174    
1175            case PT_LAMP:            case PT_LAMP:
1176            OK = prop->chartype == ucp_Lu || prop->chartype == ucp_Ll ||            OK = prop->chartype == ucp_Lu || prop->chartype == ucp_Ll ||
1177              prop->chartype == ucp_Lt;              prop->chartype == ucp_Lt;
1178            break;            break;
1179    
# Line 1190  for (;;) Line 1190  for (;;)
1190            break;            break;
1191    
1192            /* These are specials for combination cases. */            /* These are specials for combination cases. */
1193    
1194            case PT_ALNUM:            case PT_ALNUM:
1195            OK = _pcre_ucp_gentype[prop->chartype] == ucp_L ||            OK = _pcre_ucp_gentype[prop->chartype] == ucp_L ||
1196                 _pcre_ucp_gentype[prop->chartype] == ucp_N;                 _pcre_ucp_gentype[prop->chartype] == ucp_N;
1197            break;            break;
1198    
1199            case PT_SPACE:    /* Perl space */            case PT_SPACE:    /* Perl space */
1200            OK = _pcre_ucp_gentype[prop->chartype] == ucp_Z ||            OK = _pcre_ucp_gentype[prop->chartype] == ucp_Z ||
1201                 c == CHAR_HT || c == CHAR_NL || c == CHAR_FF || c == CHAR_CR;                 c == CHAR_HT || c == CHAR_NL || c == CHAR_FF || c == CHAR_CR;
1202            break;            break;
1203    
1204            case PT_PXSPACE:  /* POSIX space */            case PT_PXSPACE:  /* POSIX space */
1205            OK = _pcre_ucp_gentype[prop->chartype] == ucp_Z ||            OK = _pcre_ucp_gentype[prop->chartype] == ucp_Z ||
1206                 c == CHAR_HT || c == CHAR_NL || c == CHAR_VT ||                 c == CHAR_HT || c == CHAR_NL || c == CHAR_VT ||
1207                 c == CHAR_FF || c == CHAR_CR;                 c == CHAR_FF || c == CHAR_CR;
1208            break;            break;
1209    
1210            case PT_WORD:            case PT_WORD:
1211            OK = _pcre_ucp_gentype[prop->chartype] == ucp_L ||            OK = _pcre_ucp_gentype[prop->chartype] == ucp_L ||
1212                 _pcre_ucp_gentype[prop->chartype] == ucp_N ||                 _pcre_ucp_gentype[prop->chartype] == ucp_N ||
1213                 c == CHAR_UNDERSCORE;                 c == CHAR_UNDERSCORE;
1214            break;            break;
1215    
1216            /* Should never occur, but keep compilers from grumbling. */            /* Should never occur, but keep compilers from grumbling. */
1217    
# Line 1420  for (;;) Line 1420  for (;;)
1420            break;            break;
1421    
1422            case PT_LAMP:            case PT_LAMP:
1423            OK = prop->chartype == ucp_Lu || prop->chartype == ucp_Ll ||            OK = prop->chartype == ucp_Lu || prop->chartype == ucp_Ll ||
1424              prop->chartype == ucp_Lt;              prop->chartype == ucp_Lt;
1425            break;            break;
1426    
# Line 1435  for (;;) Line 1435  for (;;)
1435            case PT_SC:            case PT_SC:
1436            OK = prop->script == code[3];            OK = prop->script == code[3];
1437            break;            break;
1438    
1439            /* These are specials for combination cases. */            /* These are specials for combination cases. */
1440    
1441            case PT_ALNUM:            case PT_ALNUM:
1442            OK = _pcre_ucp_gentype[prop->chartype] == ucp_L ||            OK = _pcre_ucp_gentype[prop->chartype] == ucp_L ||
1443                 _pcre_ucp_gentype[prop->chartype] == ucp_N;                 _pcre_ucp_gentype[prop->chartype] == ucp_N;
1444            break;            break;
1445    
1446            case PT_SPACE:    /* Perl space */            case PT_SPACE:    /* Perl space */
1447            OK = _pcre_ucp_gentype[prop->chartype] == ucp_Z ||            OK = _pcre_ucp_gentype[prop->chartype] == ucp_Z ||
1448                 c == CHAR_HT || c == CHAR_NL || c == CHAR_FF || c == CHAR_CR;                 c == CHAR_HT || c == CHAR_NL || c == CHAR_FF || c == CHAR_CR;
1449            break;            break;
1450    
1451            case PT_PXSPACE:  /* POSIX space */            case PT_PXSPACE:  /* POSIX space */
1452            OK = _pcre_ucp_gentype[prop->chartype] == ucp_Z ||            OK = _pcre_ucp_gentype[prop->chartype] == ucp_Z ||
1453                 c == CHAR_HT || c == CHAR_NL || c == CHAR_VT ||                 c == CHAR_HT || c == CHAR_NL || c == CHAR_VT ||
1454                 c == CHAR_FF || c == CHAR_CR;                 c == CHAR_FF || c == CHAR_CR;
1455            break;            break;
1456    
1457            case PT_WORD:            case PT_WORD:
1458            OK = _pcre_ucp_gentype[prop->chartype] == ucp_L ||            OK = _pcre_ucp_gentype[prop->chartype] == ucp_L ||
1459                 _pcre_ucp_gentype[prop->chartype] == ucp_N ||                 _pcre_ucp_gentype[prop->chartype] == ucp_N ||
1460                 c == CHAR_UNDERSCORE;                 c == CHAR_UNDERSCORE;
1461            break;            break;
1462    
1463            /* Should never occur, but keep compilers from grumbling. */            /* Should never occur, but keep compilers from grumbling. */
1464    
# Line 1692  for (;;) Line 1692  for (;;)
1692            break;            break;
1693    
1694            case PT_LAMP:            case PT_LAMP:
1695            OK = prop->chartype == ucp_Lu || prop->chartype == ucp_Ll ||            OK = prop->chartype == ucp_Lu || prop->chartype == ucp_Ll ||
1696              prop->chartype == ucp_Lt;              prop->chartype == ucp_Lt;
1697            break;            break;
1698    
# Line 1707  for (;;) Line 1707  for (;;)
1707            case PT_SC:            case PT_SC:
1708            OK = prop->script == code[5];            OK = prop->script == code[5];
1709            break;            break;
1710    
1711            /* These are specials for combination cases. */            /* These are specials for combination cases. */
1712    
1713            case PT_ALNUM:            case PT_ALNUM:
1714            OK = _pcre_ucp_gentype[prop->chartype] == ucp_L ||            OK = _pcre_ucp_gentype[prop->chartype] == ucp_L ||
1715                 _pcre_ucp_gentype[prop->chartype] == ucp_N;                 _pcre_ucp_gentype[prop->chartype] == ucp_N;
1716            break;            break;
1717    
1718            case PT_SPACE:    /* Perl space */            case PT_SPACE:    /* Perl space */
1719            OK = _pcre_ucp_gentype[prop->chartype] == ucp_Z ||            OK = _pcre_ucp_gentype[prop->chartype] == ucp_Z ||
1720                 c == CHAR_HT || c == CHAR_NL || c == CHAR_FF || c == CHAR_CR;                 c == CHAR_HT || c == CHAR_NL || c == CHAR_FF || c == CHAR_CR;
1721            break;            break;
1722    
1723            case PT_PXSPACE:  /* POSIX space */            case PT_PXSPACE:  /* POSIX space */
1724            OK = _pcre_ucp_gentype[prop->chartype] == ucp_Z ||            OK = _pcre_ucp_gentype[prop->chartype] == ucp_Z ||
1725                 c == CHAR_HT || c == CHAR_NL || c == CHAR_VT ||                 c == CHAR_HT || c == CHAR_NL || c == CHAR_VT ||
1726                 c == CHAR_FF || c == CHAR_CR;                 c == CHAR_FF || c == CHAR_CR;
1727            break;            break;
1728    
1729            case PT_WORD:            case PT_WORD:
1730            OK = _pcre_ucp_gentype[prop->chartype] == ucp_L ||            OK = _pcre_ucp_gentype[prop->chartype] == ucp_L ||
1731                 _pcre_ucp_gentype[prop->chartype] == ucp_N ||                 _pcre_ucp_gentype[prop->chartype] == ucp_N ||
1732                 c == CHAR_UNDERSCORE;                 c == CHAR_UNDERSCORE;
1733            break;            break;
1734    
1735            /* Should never occur, but keep compilers from grumbling. */            /* Should never occur, but keep compilers from grumbling. */
1736    
# Line 2359  for (;;) Line 2359  for (;;)
2359          points to the byte after the end of the class. If there is a          points to the byte after the end of the class. If there is a
2360          quantifier, this is where it will be. */          quantifier, this is where it will be. */
2361    
2362          next_state_offset = ecode - start_code;          next_state_offset = (int)(ecode - start_code);
2363    
2364          switch (*ecode)          switch (*ecode)
2365            {            {
# Line 2430  for (;;) Line 2430  for (;;)
2430            md,                                   /* static match data */            md,                                   /* static match data */
2431            code,                                 /* this subexpression's code */            code,                                 /* this subexpression's code */
2432            ptr,                                  /* where we currently are */            ptr,                                  /* where we currently are */
2433            ptr - start_subject,                  /* start offset */            (int)(ptr - start_subject),           /* start offset */
2434            local_offsets,                        /* offset vector */            local_offsets,                        /* offset vector */
2435            sizeof(local_offsets)/sizeof(int),    /* size of same */            sizeof(local_offsets)/sizeof(int),    /* size of same */
2436            local_workspace,                      /* workspace vector */            local_workspace,                      /* workspace vector */
# Line 2441  for (;;) Line 2441  for (;;)
2441    
2442          if (rc == PCRE_ERROR_DFA_UITEM) return rc;          if (rc == PCRE_ERROR_DFA_UITEM) return rc;
2443          if ((rc >= 0) == (codevalue == OP_ASSERT || codevalue == OP_ASSERTBACK))          if ((rc >= 0) == (codevalue == OP_ASSERT || codevalue == OP_ASSERTBACK))
2444              { ADD_ACTIVE(endasscode + LINK_SIZE + 1 - start_code, 0); }              { ADD_ACTIVE((int)(endasscode + LINK_SIZE + 1 - start_code), 0); }
2445          }          }
2446        break;        break;
2447    
# Line 2468  for (;;) Line 2468  for (;;)
2468              cb.callout_number   = code[LINK_SIZE+2];              cb.callout_number   = code[LINK_SIZE+2];
2469              cb.offset_vector    = offsets;              cb.offset_vector    = offsets;
2470              cb.subject          = (PCRE_SPTR)start_subject;              cb.subject          = (PCRE_SPTR)start_subject;
2471              cb.subject_length   = end_subject - start_subject;              cb.subject_length   = (int)(end_subject - start_subject);
2472              cb.start_match      = current_subject - start_subject;              cb.start_match      = (int)(current_subject - start_subject);
2473              cb.current_position = ptr - start_subject;              cb.current_position = (int)(ptr - start_subject);
2474              cb.pattern_position = GET(code, LINK_SIZE + 3);              cb.pattern_position = GET(code, LINK_SIZE + 3);
2475              cb.next_item_length = GET(code, 3 + 2*LINK_SIZE);              cb.next_item_length = GET(code, 3 + 2*LINK_SIZE);
2476              cb.capture_top      = 1;              cb.capture_top      = 1;
# Line 2521  for (;;) Line 2521  for (;;)
2521              md,                                   /* fixed match data */              md,                                   /* fixed match data */
2522              asscode,                              /* this subexpression's code */              asscode,                              /* this subexpression's code */
2523              ptr,                                  /* where we currently are */              ptr,                                  /* where we currently are */
2524              ptr - start_subject,                  /* start offset */              (int)(ptr - start_subject),           /* start offset */
2525              local_offsets,                        /* offset vector */              local_offsets,                        /* offset vector */
2526              sizeof(local_offsets)/sizeof(int),    /* size of same */              sizeof(local_offsets)/sizeof(int),    /* size of same */
2527              local_workspace,                      /* workspace vector */              local_workspace,                      /* workspace vector */
# Line 2533  for (;;) Line 2533  for (;;)
2533            if (rc == PCRE_ERROR_DFA_UITEM) return rc;            if (rc == PCRE_ERROR_DFA_UITEM) return rc;
2534            if ((rc >= 0) ==            if ((rc >= 0) ==
2535                  (condcode == OP_ASSERT || condcode == OP_ASSERTBACK))                  (condcode == OP_ASSERT || condcode == OP_ASSERTBACK))
2536              { ADD_ACTIVE(endasscode + LINK_SIZE + 1 - start_code, 0); }              { ADD_ACTIVE((int)(endasscode + LINK_SIZE + 1 - start_code), 0); }
2537            else            else
2538              { ADD_ACTIVE(state_offset + codelink + LINK_SIZE + 1, 0); }              { ADD_ACTIVE(state_offset + codelink + LINK_SIZE + 1, 0); }
2539            }            }
# Line 2554  for (;;) Line 2554  for (;;)
2554            md,                                   /* fixed match data */            md,                                   /* fixed match data */
2555            start_code + GET(code, 1),            /* this subexpression's code */            start_code + GET(code, 1),            /* this subexpression's code */
2556            ptr,                                  /* where we currently are */            ptr,                                  /* where we currently are */
2557            ptr - start_subject,                  /* start offset */            (int)(ptr - start_subject),           /* start offset */
2558            local_offsets,                        /* offset vector */            local_offsets,                        /* offset vector */
2559            sizeof(local_offsets)/sizeof(int),    /* size of same */            sizeof(local_offsets)/sizeof(int),    /* size of same */
2560            local_workspace,                      /* workspace vector */            local_workspace,                      /* workspace vector */
# Line 2606  for (;;) Line 2606  for (;;)
2606            md,                                   /* fixed match data */            md,                                   /* fixed match data */
2607            code,                                 /* this subexpression's code */            code,                                 /* this subexpression's code */
2608            ptr,                                  /* where we currently are */            ptr,                                  /* where we currently are */
2609            ptr - start_subject,                  /* start offset */            (int)(ptr - start_subject),           /* start offset */
2610            local_offsets,                        /* offset vector */            local_offsets,                        /* offset vector */
2611            sizeof(local_offsets)/sizeof(int),    /* size of same */            sizeof(local_offsets)/sizeof(int),    /* size of same */
2612            local_workspace,                      /* workspace vector */            local_workspace,                      /* workspace vector */
# Line 2623  for (;;) Line 2623  for (;;)
2623    
2624            do { end_subpattern += GET(end_subpattern, 1); }            do { end_subpattern += GET(end_subpattern, 1); }
2625              while (*end_subpattern == OP_ALT);              while (*end_subpattern == OP_ALT);
2626            next_state_offset = end_subpattern - start_code + LINK_SIZE + 1;            next_state_offset =
2627                (int)(end_subpattern - start_code + LINK_SIZE + 1);
2628    
2629            /* If the end of this subpattern is KETRMAX or KETRMIN, we must            /* If the end of this subpattern is KETRMAX or KETRMIN, we must
2630            arrange for the repeat state also to be added to the relevant list.            arrange for the repeat state also to be added to the relevant list.
# Line 2631  for (;;) Line 2632  for (;;)
2632    
2633            repeat_state_offset = (*end_subpattern == OP_KETRMAX ||            repeat_state_offset = (*end_subpattern == OP_KETRMAX ||
2634                                   *end_subpattern == OP_KETRMIN)?                                   *end_subpattern == OP_KETRMIN)?
2635              end_subpattern - start_code - GET(end_subpattern, 1) : -1;              (int)(end_subpattern - start_code - GET(end_subpattern, 1)) : -1;
2636    
2637            /* If we have matched an empty string, add the next state at the            /* If we have matched an empty string, add the next state at the
2638            current character pointer. This is important so that the duplicate            current character pointer. This is important so that the duplicate
# Line 2695  for (;;) Line 2696  for (;;)
2696          cb.callout_number   = code[1];          cb.callout_number   = code[1];
2697          cb.offset_vector    = offsets;          cb.offset_vector    = offsets;
2698          cb.subject          = (PCRE_SPTR)start_subject;          cb.subject          = (PCRE_SPTR)start_subject;
2699          cb.subject_length   = end_subject - start_subject;          cb.subject_length   = (int)(end_subject - start_subject);
2700          cb.start_match      = current_subject - start_subject;          cb.start_match      = (int)(current_subject - start_subject);
2701          cb.current_position = ptr - start_subject;          cb.current_position = (int)(ptr - start_subject);
2702          cb.pattern_position = GET(code, 2);          cb.pattern_position = GET(code, 2);
2703          cb.next_item_length = GET(code, 2 + LINK_SIZE);          cb.next_item_length = GET(code, 2 + LINK_SIZE);
2704          cb.capture_top      = 1;          cb.capture_top      = 1;
# Line 2748  for (;;) Line 2749  for (;;)
2749        {        {
2750        if (offsetcount >= 2)        if (offsetcount >= 2)
2751          {          {
2752          offsets[0] = md->start_used_ptr - start_subject;          offsets[0] = (int)(md->start_used_ptr - start_subject);
2753          offsets[1] = end_subject - start_subject;          offsets[1] = (int)(end_subject - start_subject);
2754          }          }
2755        match_count = PCRE_ERROR_PARTIAL;        match_count = PCRE_ERROR_PARTIAL;
2756        }        }

Legend:
Removed from v.518  
changed lines
  Added in v.535

  ViewVC Help
Powered by ViewVC 1.1.5