| 142 |
eptr pointer into the subject |
eptr pointer into the subject |
| 143 |
length length of reference to be matched (number of bytes) |
length length of reference to be matched (number of bytes) |
| 144 |
md points to match data block |
md points to match data block |
| 145 |
ims the ims flags |
caseless TRUE if caseless |
| 146 |
|
|
| 147 |
Returns: < 0 if not matched, otherwise the number of subject bytes matched |
Returns: < 0 if not matched, otherwise the number of subject bytes matched |
| 148 |
*/ |
*/ |
| 149 |
|
|
| 150 |
static int |
static int |
| 151 |
match_ref(int offset, register USPTR eptr, int length, match_data *md, |
match_ref(int offset, register USPTR eptr, int length, match_data *md, |
| 152 |
unsigned long int ims) |
BOOL caseless) |
| 153 |
{ |
{ |
| 154 |
USPTR eptr_start = eptr; |
USPTR eptr_start = eptr; |
| 155 |
register USPTR p = md->start_subject + md->offset_vector[offset]; |
register USPTR p = md->start_subject + md->offset_vector[offset]; |
| 175 |
properly if Unicode properties are supported. Otherwise, we can check only |
properly if Unicode properties are supported. Otherwise, we can check only |
| 176 |
ASCII characters. */ |
ASCII characters. */ |
| 177 |
|
|
| 178 |
if ((ims & PCRE_CASELESS) != 0) |
if (caseless) |
| 179 |
{ |
{ |
| 180 |
#ifdef SUPPORT_UTF8 |
#ifdef SUPPORT_UTF8 |
| 181 |
#ifdef SUPPORT_UCP |
#ifdef SUPPORT_UCP |
| 283 |
#define REGISTER register |
#define REGISTER register |
| 284 |
|
|
| 285 |
#ifdef PCRE_DEBUG |
#ifdef PCRE_DEBUG |
| 286 |
#define RMATCH(ra,rb,rc,rd,re,rf,rg,rw) \ |
#define RMATCH(ra,rb,rc,rd,re,rf,rw) \ |
| 287 |
{ \ |
{ \ |
| 288 |
printf("match() called in line %d\n", __LINE__); \ |
printf("match() called in line %d\n", __LINE__); \ |
| 289 |
rrc = match(ra,rb,mstart,markptr,rc,rd,re,rf,rg,rdepth+1); \ |
rrc = match(ra,rb,mstart,markptr,rc,rd,re,rf,rdepth+1); \ |
| 290 |
printf("to line %d\n", __LINE__); \ |
printf("to line %d\n", __LINE__); \ |
| 291 |
} |
} |
| 292 |
#define RRETURN(ra) \ |
#define RRETURN(ra) \ |
| 295 |
return ra; \ |
return ra; \ |
| 296 |
} |
} |
| 297 |
#else |
#else |
| 298 |
#define RMATCH(ra,rb,rc,rd,re,rf,rg,rw) \ |
#define RMATCH(ra,rb,rc,rd,re,rf,rw) \ |
| 299 |
rrc = match(ra,rb,mstart,markptr,rc,rd,re,rf,rg,rdepth+1) |
rrc = match(ra,rb,mstart,markptr,rc,rd,re,rf,rdepth+1) |
| 300 |
#define RRETURN(ra) return ra |
#define RRETURN(ra) return ra |
| 301 |
#endif |
#endif |
| 302 |
|
|
| 309 |
|
|
| 310 |
#define REGISTER |
#define REGISTER |
| 311 |
|
|
| 312 |
#define RMATCH(ra,rb,rc,rd,re,rf,rg,rw)\ |
#define RMATCH(ra,rb,rc,rd,re,rf,rw)\ |
| 313 |
{\ |
{\ |
| 314 |
heapframe *newframe = (heapframe *)(pcre_stack_malloc)(sizeof(heapframe));\ |
heapframe *newframe = (heapframe *)(pcre_stack_malloc)(sizeof(heapframe));\ |
| 315 |
if (newframe == NULL) RRETURN(PCRE_ERROR_NOMEMORY);\ |
if (newframe == NULL) RRETURN(PCRE_ERROR_NOMEMORY);\ |
| 319 |
newframe->Xmstart = mstart;\ |
newframe->Xmstart = mstart;\ |
| 320 |
newframe->Xmarkptr = markptr;\ |
newframe->Xmarkptr = markptr;\ |
| 321 |
newframe->Xoffset_top = rc;\ |
newframe->Xoffset_top = rc;\ |
| 322 |
newframe->Xims = re;\ |
newframe->Xeptrb = re;\ |
| 323 |
newframe->Xeptrb = rf;\ |
newframe->Xflags = rf;\ |
|
newframe->Xflags = rg;\ |
|
| 324 |
newframe->Xrdepth = frame->Xrdepth + 1;\ |
newframe->Xrdepth = frame->Xrdepth + 1;\ |
| 325 |
newframe->Xprevframe = frame;\ |
newframe->Xprevframe = frame;\ |
| 326 |
frame = newframe;\ |
frame = newframe;\ |
| 356 |
USPTR Xmstart; |
USPTR Xmstart; |
| 357 |
USPTR Xmarkptr; |
USPTR Xmarkptr; |
| 358 |
int Xoffset_top; |
int Xoffset_top; |
|
long int Xims; |
|
| 359 |
eptrblock *Xeptrb; |
eptrblock *Xeptrb; |
| 360 |
int Xflags; |
int Xflags; |
| 361 |
unsigned int Xrdepth; |
unsigned int Xrdepth; |
| 378 |
BOOL Xcondition; |
BOOL Xcondition; |
| 379 |
BOOL Xprev_is_word; |
BOOL Xprev_is_word; |
| 380 |
|
|
|
unsigned long int Xoriginal_ims; |
|
|
|
|
| 381 |
#ifdef SUPPORT_UCP |
#ifdef SUPPORT_UCP |
| 382 |
int Xprop_type; |
int Xprop_type; |
| 383 |
int Xprop_value; |
int Xprop_value; |
| 463 |
markptr pointer to the most recent MARK name, or NULL |
markptr pointer to the most recent MARK name, or NULL |
| 464 |
offset_top current top pointer |
offset_top current top pointer |
| 465 |
md pointer to "static" info for the match |
md pointer to "static" info for the match |
|
ims current /i, /m, and /s options |
|
| 466 |
eptrb pointer to chain of blocks containing eptr at start of |
eptrb pointer to chain of blocks containing eptr at start of |
| 467 |
brackets - for testing for empty matches |
brackets - for testing for empty matches |
| 468 |
flags can contain |
flags can contain |
| 480 |
|
|
| 481 |
static int |
static int |
| 482 |
match(REGISTER USPTR eptr, REGISTER const uschar *ecode, USPTR mstart, |
match(REGISTER USPTR eptr, REGISTER const uschar *ecode, USPTR mstart, |
| 483 |
const uschar *markptr, int offset_top, match_data *md, unsigned long int ims, |
const uschar *markptr, int offset_top, match_data *md, eptrblock *eptrb, |
| 484 |
eptrblock *eptrb, int flags, unsigned int rdepth) |
int flags, unsigned int rdepth) |
| 485 |
{ |
{ |
| 486 |
/* These variables do not need to be preserved over recursion in this function, |
/* These variables do not need to be preserved over recursion in this function, |
| 487 |
so they can be ordinary variables in all cases. Mark some of them with |
so they can be ordinary variables in all cases. Mark some of them with |
| 493 |
register BOOL utf8; /* Local copy of UTF-8 flag for speed */ |
register BOOL utf8; /* Local copy of UTF-8 flag for speed */ |
| 494 |
|
|
| 495 |
BOOL minimize, possessive; /* Quantifier options */ |
BOOL minimize, possessive; /* Quantifier options */ |
| 496 |
|
BOOL caseless; |
| 497 |
int condcode; |
int condcode; |
| 498 |
|
|
| 499 |
/* When recursion is not being used, all "local" variables that have to be |
/* When recursion is not being used, all "local" variables that have to be |
| 513 |
frame->Xmstart = mstart; |
frame->Xmstart = mstart; |
| 514 |
frame->Xmarkptr = markptr; |
frame->Xmarkptr = markptr; |
| 515 |
frame->Xoffset_top = offset_top; |
frame->Xoffset_top = offset_top; |
|
frame->Xims = ims; |
|
| 516 |
frame->Xeptrb = eptrb; |
frame->Xeptrb = eptrb; |
| 517 |
frame->Xflags = flags; |
frame->Xflags = flags; |
| 518 |
frame->Xrdepth = rdepth; |
frame->Xrdepth = rdepth; |
| 528 |
#define mstart frame->Xmstart |
#define mstart frame->Xmstart |
| 529 |
#define markptr frame->Xmarkptr |
#define markptr frame->Xmarkptr |
| 530 |
#define offset_top frame->Xoffset_top |
#define offset_top frame->Xoffset_top |
|
#define ims frame->Xims |
|
| 531 |
#define eptrb frame->Xeptrb |
#define eptrb frame->Xeptrb |
| 532 |
#define flags frame->Xflags |
#define flags frame->Xflags |
| 533 |
#define rdepth frame->Xrdepth |
#define rdepth frame->Xrdepth |
| 551 |
#define condition frame->Xcondition |
#define condition frame->Xcondition |
| 552 |
#define prev_is_word frame->Xprev_is_word |
#define prev_is_word frame->Xprev_is_word |
| 553 |
|
|
|
#define original_ims frame->Xoriginal_ims |
|
|
|
|
| 554 |
#ifdef SUPPORT_UCP |
#ifdef SUPPORT_UCP |
| 555 |
#define prop_type frame->Xprop_type |
#define prop_type frame->Xprop_type |
| 556 |
#define prop_value frame->Xprop_value |
#define prop_value frame->Xprop_value |
| 604 |
BOOL condition; |
BOOL condition; |
| 605 |
BOOL prev_is_word; |
BOOL prev_is_word; |
| 606 |
|
|
|
unsigned long int original_ims; |
|
|
|
|
| 607 |
#ifdef SUPPORT_UCP |
#ifdef SUPPORT_UCP |
| 608 |
int prop_type; |
int prop_type; |
| 609 |
int prop_value; |
int prop_value; |
| 666 |
if (md->match_call_count++ >= md->match_limit) RRETURN(PCRE_ERROR_MATCHLIMIT); |
if (md->match_call_count++ >= md->match_limit) RRETURN(PCRE_ERROR_MATCHLIMIT); |
| 667 |
if (rdepth >= md->match_limit_recursion) RRETURN(PCRE_ERROR_RECURSIONLIMIT); |
if (rdepth >= md->match_limit_recursion) RRETURN(PCRE_ERROR_RECURSIONLIMIT); |
| 668 |
|
|
|
original_ims = ims; /* Save for resetting on ')' */ |
|
|
|
|
| 669 |
/* At the start of a group with an unlimited repeat that may match an empty |
/* At the start of a group with an unlimited repeat that may match an empty |
| 670 |
string, the match_cbegroup flag is set. When this is the case, add the current |
string, the match_cbegroup flag is set. When this is the case, add the current |
| 671 |
subject pointer to the chain of such remembered pointers, to be checked when we |
subject pointer to the chain of such remembered pointers, to be checked when we |
| 694 |
case OP_MARK: |
case OP_MARK: |
| 695 |
markptr = ecode + 2; |
markptr = ecode + 2; |
| 696 |
RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode] + ecode[1], offset_top, md, |
RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode] + ecode[1], offset_top, md, |
| 697 |
ims, eptrb, flags, RM55); |
eptrb, flags, RM55); |
| 698 |
|
|
| 699 |
/* A return of MATCH_SKIP_ARG means that matching failed at SKIP with an |
/* A return of MATCH_SKIP_ARG means that matching failed at SKIP with an |
| 700 |
argument, and we must check whether that argument matches this MARK's |
argument, and we must check whether that argument matches this MARK's |
| 720 |
|
|
| 721 |
case OP_COMMIT: |
case OP_COMMIT: |
| 722 |
RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode], offset_top, md, |
RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode], offset_top, md, |
| 723 |
ims, eptrb, flags, RM52); |
eptrb, flags, RM52); |
| 724 |
if (rrc != MATCH_NOMATCH && rrc != MATCH_PRUNE && |
if (rrc != MATCH_NOMATCH && rrc != MATCH_PRUNE && |
| 725 |
rrc != MATCH_SKIP && rrc != MATCH_SKIP_ARG && |
rrc != MATCH_SKIP && rrc != MATCH_SKIP_ARG && |
| 726 |
rrc != MATCH_THEN) |
rrc != MATCH_THEN) |
| 731 |
|
|
| 732 |
case OP_PRUNE: |
case OP_PRUNE: |
| 733 |
RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode], offset_top, md, |
RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode], offset_top, md, |
| 734 |
ims, eptrb, flags, RM51); |
eptrb, flags, RM51); |
| 735 |
if (rrc != MATCH_NOMATCH && rrc != MATCH_THEN) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH && rrc != MATCH_THEN) RRETURN(rrc); |
| 736 |
MRRETURN(MATCH_PRUNE); |
MRRETURN(MATCH_PRUNE); |
| 737 |
|
|
| 738 |
case OP_PRUNE_ARG: |
case OP_PRUNE_ARG: |
| 739 |
RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode] + ecode[1], offset_top, md, |
RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode] + ecode[1], offset_top, md, |
| 740 |
ims, eptrb, flags, RM56); |
eptrb, flags, RM56); |
| 741 |
if (rrc != MATCH_NOMATCH && rrc != MATCH_THEN) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH && rrc != MATCH_THEN) RRETURN(rrc); |
| 742 |
md->mark = ecode + 2; |
md->mark = ecode + 2; |
| 743 |
RRETURN(MATCH_PRUNE); |
RRETURN(MATCH_PRUNE); |
| 746 |
|
|
| 747 |
case OP_SKIP: |
case OP_SKIP: |
| 748 |
RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode], offset_top, md, |
RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode], offset_top, md, |
| 749 |
ims, eptrb, flags, RM53); |
eptrb, flags, RM53); |
| 750 |
if (rrc != MATCH_NOMATCH && rrc != MATCH_PRUNE && rrc != MATCH_THEN) |
if (rrc != MATCH_NOMATCH && rrc != MATCH_PRUNE && rrc != MATCH_THEN) |
| 751 |
RRETURN(rrc); |
RRETURN(rrc); |
| 752 |
md->start_match_ptr = eptr; /* Pass back current position */ |
md->start_match_ptr = eptr; /* Pass back current position */ |
| 754 |
|
|
| 755 |
case OP_SKIP_ARG: |
case OP_SKIP_ARG: |
| 756 |
RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode] + ecode[1], offset_top, md, |
RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode] + ecode[1], offset_top, md, |
| 757 |
ims, eptrb, flags, RM57); |
eptrb, flags, RM57); |
| 758 |
if (rrc != MATCH_NOMATCH && rrc != MATCH_PRUNE && rrc != MATCH_THEN) |
if (rrc != MATCH_NOMATCH && rrc != MATCH_PRUNE && rrc != MATCH_THEN) |
| 759 |
RRETURN(rrc); |
RRETURN(rrc); |
| 760 |
|
|
| 773 |
|
|
| 774 |
case OP_THEN: |
case OP_THEN: |
| 775 |
RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode], offset_top, md, |
RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode], offset_top, md, |
| 776 |
ims, eptrb, flags, RM54); |
eptrb, flags, RM54); |
| 777 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 778 |
md->start_match_ptr = ecode - GET(ecode, 1); |
md->start_match_ptr = ecode - GET(ecode, 1); |
| 779 |
MRRETURN(MATCH_THEN); |
MRRETURN(MATCH_THEN); |
| 780 |
|
|
| 781 |
case OP_THEN_ARG: |
case OP_THEN_ARG: |
| 782 |
RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode] + ecode[1+LINK_SIZE], |
RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode] + ecode[1+LINK_SIZE], |
| 783 |
offset_top, md, ims, eptrb, flags, RM58); |
offset_top, md, eptrb, flags, RM58); |
| 784 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 785 |
md->start_match_ptr = ecode - GET(ecode, 1); |
md->start_match_ptr = ecode - GET(ecode, 1); |
| 786 |
md->mark = ecode + LINK_SIZE + 2; |
md->mark = ecode + LINK_SIZE + 2; |
| 827 |
do |
do |
| 828 |
{ |
{ |
| 829 |
RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode], offset_top, md, |
RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode], offset_top, md, |
| 830 |
ims, eptrb, flags, RM1); |
eptrb, flags, RM1); |
| 831 |
if (rrc != MATCH_NOMATCH && |
if (rrc != MATCH_NOMATCH && |
| 832 |
(rrc != MATCH_THEN || md->start_match_ptr != ecode)) |
(rrc != MATCH_THEN || md->start_match_ptr != ecode)) |
| 833 |
RRETURN(rrc); |
RRETURN(rrc); |
| 880 |
|
|
| 881 |
/* Possibly empty group; can't use tail recursion. */ |
/* Possibly empty group; can't use tail recursion. */ |
| 882 |
|
|
| 883 |
RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode], offset_top, md, ims, |
RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode], offset_top, md, eptrb, |
| 884 |
eptrb, flags, RM48); |
flags, RM48); |
| 885 |
if (rrc == MATCH_NOMATCH) md->mark = markptr; |
if (rrc == MATCH_NOMATCH) md->mark = markptr; |
| 886 |
RRETURN(rrc); |
RRETURN(rrc); |
| 887 |
} |
} |
| 889 |
/* For non-final alternatives, continue the loop for a NOMATCH result; |
/* For non-final alternatives, continue the loop for a NOMATCH result; |
| 890 |
otherwise return. */ |
otherwise return. */ |
| 891 |
|
|
| 892 |
RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode], offset_top, md, ims, |
RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode], offset_top, md, eptrb, |
| 893 |
eptrb, flags, RM2); |
flags, RM2); |
| 894 |
if (rrc != MATCH_NOMATCH && |
if (rrc != MATCH_NOMATCH && |
| 895 |
(rrc != MATCH_THEN || md->start_match_ptr != ecode)) |
(rrc != MATCH_THEN || md->start_match_ptr != ecode)) |
| 896 |
RRETURN(rrc); |
RRETURN(rrc); |
| 1086 |
|
|
| 1087 |
else |
else |
| 1088 |
{ |
{ |
| 1089 |
RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims, NULL, |
RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, NULL, |
| 1090 |
match_condassert, RM3); |
match_condassert, RM3); |
| 1091 |
if (rrc == MATCH_MATCH) |
if (rrc == MATCH_MATCH) |
| 1092 |
{ |
{ |
| 1116 |
ecode += 1 + LINK_SIZE; |
ecode += 1 + LINK_SIZE; |
| 1117 |
if (op == OP_SCOND) /* Possibly empty group */ |
if (op == OP_SCOND) /* Possibly empty group */ |
| 1118 |
{ |
{ |
| 1119 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, match_cbegroup, RM49); |
RMATCH(eptr, ecode, offset_top, md, eptrb, match_cbegroup, RM49); |
| 1120 |
RRETURN(rrc); |
RRETURN(rrc); |
| 1121 |
} |
} |
| 1122 |
else /* Group must match something */ |
else /* Group must match something */ |
| 1170 |
memmove(md->offset_vector, rec->offset_save, |
memmove(md->offset_vector, rec->offset_save, |
| 1171 |
rec->saved_max * sizeof(int)); |
rec->saved_max * sizeof(int)); |
| 1172 |
offset_top = rec->save_offset_top; |
offset_top = rec->save_offset_top; |
|
ims = original_ims; |
|
| 1173 |
ecode = rec->after_call; |
ecode = rec->after_call; |
| 1174 |
break; |
break; |
| 1175 |
} |
} |
| 1197 |
rrc = (op == OP_END)? MATCH_MATCH : MATCH_ACCEPT; |
rrc = (op == OP_END)? MATCH_MATCH : MATCH_ACCEPT; |
| 1198 |
MRRETURN(rrc); |
MRRETURN(rrc); |
| 1199 |
|
|
|
/* Change option settings */ |
|
|
|
|
|
case OP_OPT: |
|
|
ims = ecode[1]; |
|
|
ecode += 2; |
|
|
DPRINTF(("ims set to %02lx\n", ims)); |
|
|
break; |
|
|
|
|
| 1200 |
/* Assertion brackets. Check the alternative branches in turn - the |
/* Assertion brackets. Check the alternative branches in turn - the |
| 1201 |
matching won't pass the KET for an assertion. If any one branch matches, |
matching won't pass the KET for an assertion. If any one branch matches, |
| 1202 |
the assertion is true. Lookbehind assertions have an OP_REVERSE item at the |
the assertion is true. Lookbehind assertions have an OP_REVERSE item at the |
| 1207 |
case OP_ASSERTBACK: |
case OP_ASSERTBACK: |
| 1208 |
do |
do |
| 1209 |
{ |
{ |
| 1210 |
RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims, NULL, 0, |
RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, NULL, 0, |
| 1211 |
RM4); |
RM4); |
| 1212 |
if (rrc == MATCH_MATCH || rrc == MATCH_ACCEPT) |
if (rrc == MATCH_MATCH || rrc == MATCH_ACCEPT) |
| 1213 |
{ |
{ |
| 1242 |
case OP_ASSERTBACK_NOT: |
case OP_ASSERTBACK_NOT: |
| 1243 |
do |
do |
| 1244 |
{ |
{ |
| 1245 |
RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims, NULL, 0, |
RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, NULL, 0, |
| 1246 |
RM5); |
RM5); |
| 1247 |
if (rrc == MATCH_MATCH || rrc == MATCH_ACCEPT) MRRETURN(MATCH_NOMATCH); |
if (rrc == MATCH_MATCH || rrc == MATCH_ACCEPT) MRRETURN(MATCH_NOMATCH); |
| 1248 |
if (rrc == MATCH_SKIP || rrc == MATCH_PRUNE || rrc == MATCH_COMMIT) |
if (rrc == MATCH_SKIP || rrc == MATCH_PRUNE || rrc == MATCH_COMMIT) |
| 1380 |
do |
do |
| 1381 |
{ |
{ |
| 1382 |
RMATCH(eptr, callpat + _pcre_OP_lengths[*callpat], offset_top, |
RMATCH(eptr, callpat + _pcre_OP_lengths[*callpat], offset_top, |
| 1383 |
md, ims, eptrb, flags, RM6); |
md, eptrb, flags, RM6); |
| 1384 |
if (rrc == MATCH_MATCH || rrc == MATCH_ACCEPT) |
if (rrc == MATCH_MATCH || rrc == MATCH_ACCEPT) |
| 1385 |
{ |
{ |
| 1386 |
DPRINTF(("Recursion matched\n")); |
DPRINTF(("Recursion matched\n")); |
| 1427 |
|
|
| 1428 |
do |
do |
| 1429 |
{ |
{ |
| 1430 |
RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims, eptrb, 0, RM7); |
RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, eptrb, 0, RM7); |
| 1431 |
if (rrc == MATCH_MATCH) /* Note: _not_ MATCH_ACCEPT */ |
if (rrc == MATCH_MATCH) /* Note: _not_ MATCH_ACCEPT */ |
| 1432 |
{ |
{ |
| 1433 |
mstart = md->start_match_ptr; |
mstart = md->start_match_ptr; |
| 1466 |
|
|
| 1467 |
/* The repeating kets try the rest of the pattern or restart from the |
/* The repeating kets try the rest of the pattern or restart from the |
| 1468 |
preceding bracket, in the appropriate order. The second "call" of match() |
preceding bracket, in the appropriate order. The second "call" of match() |
| 1469 |
uses tail recursion, to avoid using another stack frame. We need to reset |
uses tail recursion, to avoid using another stack frame. */ |
|
any options that changed within the bracket before re-running it, so |
|
|
check the next opcode. */ |
|
|
|
|
|
if (ecode[1+LINK_SIZE] == OP_OPT) |
|
|
{ |
|
|
ims = (ims & ~PCRE_IMS) | ecode[4]; |
|
|
DPRINTF(("ims set to %02lx at group repeat\n", ims)); |
|
|
} |
|
| 1470 |
|
|
| 1471 |
if (*ecode == OP_KETRMIN) |
if (*ecode == OP_KETRMIN) |
| 1472 |
{ |
{ |
| 1473 |
RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims, eptrb, 0, RM8); |
RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, eptrb, 0, RM8); |
| 1474 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 1475 |
ecode = prev; |
ecode = prev; |
| 1476 |
flags = 0; |
flags = 0; |
| 1478 |
} |
} |
| 1479 |
else /* OP_KETRMAX */ |
else /* OP_KETRMAX */ |
| 1480 |
{ |
{ |
| 1481 |
RMATCH(eptr, prev, offset_top, md, ims, eptrb, match_cbegroup, RM9); |
RMATCH(eptr, prev, offset_top, md, eptrb, match_cbegroup, RM9); |
| 1482 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 1483 |
ecode += 1 + LINK_SIZE; |
ecode += 1 + LINK_SIZE; |
| 1484 |
flags = 0; |
flags = 0; |
| 1502 |
case OP_BRAZERO: |
case OP_BRAZERO: |
| 1503 |
{ |
{ |
| 1504 |
next = ecode+1; |
next = ecode+1; |
| 1505 |
RMATCH(eptr, next, offset_top, md, ims, eptrb, 0, RM10); |
RMATCH(eptr, next, offset_top, md, eptrb, 0, RM10); |
| 1506 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 1507 |
do next += GET(next,1); while (*next == OP_ALT); |
do next += GET(next,1); while (*next == OP_ALT); |
| 1508 |
ecode = next + 1 + LINK_SIZE; |
ecode = next + 1 + LINK_SIZE; |
| 1513 |
{ |
{ |
| 1514 |
next = ecode+1; |
next = ecode+1; |
| 1515 |
do next += GET(next, 1); while (*next == OP_ALT); |
do next += GET(next, 1); while (*next == OP_ALT); |
| 1516 |
RMATCH(eptr, next + 1+LINK_SIZE, offset_top, md, ims, eptrb, 0, RM11); |
RMATCH(eptr, next + 1+LINK_SIZE, offset_top, md, eptrb, 0, RM11); |
| 1517 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 1518 |
ecode++; |
ecode++; |
| 1519 |
} |
} |
| 1597 |
rec->saved_max * sizeof(int)); |
rec->saved_max * sizeof(int)); |
| 1598 |
offset_top = rec->save_offset_top; |
offset_top = rec->save_offset_top; |
| 1599 |
ecode = rec->after_call; |
ecode = rec->after_call; |
|
ims = original_ims; |
|
| 1600 |
break; |
break; |
| 1601 |
} |
} |
| 1602 |
} |
} |
| 1603 |
|
|
|
/* For both capturing and non-capturing groups, reset the value of the ims |
|
|
flags, in case they got changed during the group. */ |
|
|
|
|
|
ims = original_ims; |
|
|
DPRINTF(("ims reset to %02lx\n", ims)); |
|
|
|
|
| 1604 |
/* For a non-repeating ket, just continue at this level. This also |
/* For a non-repeating ket, just continue at this level. This also |
| 1605 |
happens for a repeating ket if no characters were matched in the group. |
happens for a repeating ket if no characters were matched in the group. |
| 1606 |
This is the forcible breaking of infinite loops as implemented in Perl |
This is the forcible breaking of infinite loops as implemented in Perl |
| 1622 |
|
|
| 1623 |
if (*ecode == OP_KETRMIN) |
if (*ecode == OP_KETRMIN) |
| 1624 |
{ |
{ |
| 1625 |
RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims, eptrb, 0, RM12); |
RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, eptrb, 0, RM12); |
| 1626 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 1627 |
if (flags != 0) /* Could match an empty string */ |
if (flags != 0) /* Could match an empty string */ |
| 1628 |
{ |
{ |
| 1629 |
RMATCH(eptr, prev, offset_top, md, ims, eptrb, flags, RM50); |
RMATCH(eptr, prev, offset_top, md, eptrb, flags, RM50); |
| 1630 |
RRETURN(rrc); |
RRETURN(rrc); |
| 1631 |
} |
} |
| 1632 |
ecode = prev; |
ecode = prev; |
| 1634 |
} |
} |
| 1635 |
else /* OP_KETRMAX */ |
else /* OP_KETRMAX */ |
| 1636 |
{ |
{ |
| 1637 |
RMATCH(eptr, prev, offset_top, md, ims, eptrb, flags, RM13); |
RMATCH(eptr, prev, offset_top, md, eptrb, flags, RM13); |
| 1638 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 1639 |
ecode += 1 + LINK_SIZE; |
ecode += 1 + LINK_SIZE; |
| 1640 |
flags = 0; |
flags = 0; |
| 1642 |
} |
} |
| 1643 |
/* Control never gets here */ |
/* Control never gets here */ |
| 1644 |
|
|
| 1645 |
/* Start of subject unless notbol, or after internal newline if multiline */ |
/* Not multiline mode: start of subject assertion, unless notbol. */ |
| 1646 |
|
|
| 1647 |
case OP_CIRC: |
case OP_CIRC: |
| 1648 |
if (md->notbol && eptr == md->start_subject) MRRETURN(MATCH_NOMATCH); |
if (md->notbol && eptr == md->start_subject) MRRETURN(MATCH_NOMATCH); |
| 1649 |
if ((ims & PCRE_MULTILINE) != 0) |
|
|
{ |
|
|
if (eptr != md->start_subject && |
|
|
(eptr == md->end_subject || !WAS_NEWLINE(eptr))) |
|
|
MRRETURN(MATCH_NOMATCH); |
|
|
ecode++; |
|
|
break; |
|
|
} |
|
|
/* ... else fall through */ |
|
|
|
|
| 1650 |
/* Start of subject assertion */ |
/* Start of subject assertion */ |
| 1651 |
|
|
| 1652 |
case OP_SOD: |
case OP_SOD: |
| 1653 |
if (eptr != md->start_subject) MRRETURN(MATCH_NOMATCH); |
if (eptr != md->start_subject) MRRETURN(MATCH_NOMATCH); |
| 1654 |
ecode++; |
ecode++; |
| 1655 |
break; |
break; |
| 1656 |
|
|
| 1657 |
|
/* Multiline mode: start of subject unless notbol, or after any newline. */ |
| 1658 |
|
|
| 1659 |
|
case OP_CIRCM: |
| 1660 |
|
if (md->notbol && eptr == md->start_subject) MRRETURN(MATCH_NOMATCH); |
| 1661 |
|
if (eptr != md->start_subject && |
| 1662 |
|
(eptr == md->end_subject || !WAS_NEWLINE(eptr))) |
| 1663 |
|
MRRETURN(MATCH_NOMATCH); |
| 1664 |
|
ecode++; |
| 1665 |
|
break; |
| 1666 |
|
|
| 1667 |
/* Start of match assertion */ |
/* Start of match assertion */ |
| 1668 |
|
|
| 1678 |
ecode++; |
ecode++; |
| 1679 |
break; |
break; |
| 1680 |
|
|
| 1681 |
/* Assert before internal newline if multiline, or before a terminating |
/* Multiline mode: assert before any newline, or before end of subject |
| 1682 |
newline unless endonly is set, else end of subject unless noteol is set. */ |
unless noteol is set. */ |
| 1683 |
|
|
| 1684 |
case OP_DOLL: |
case OP_DOLLM: |
| 1685 |
if ((ims & PCRE_MULTILINE) != 0) |
if (eptr < md->end_subject) |
| 1686 |
{ |
{ if (!IS_NEWLINE(eptr)) MRRETURN(MATCH_NOMATCH); } |
| 1687 |
if (eptr < md->end_subject) |
else |
|
{ if (!IS_NEWLINE(eptr)) MRRETURN(MATCH_NOMATCH); } |
|
|
else |
|
|
{ |
|
|
if (md->noteol) MRRETURN(MATCH_NOMATCH); |
|
|
SCHECK_PARTIAL(); |
|
|
} |
|
|
ecode++; |
|
|
break; |
|
|
} |
|
|
else /* Not multiline */ |
|
| 1688 |
{ |
{ |
| 1689 |
if (md->noteol) MRRETURN(MATCH_NOMATCH); |
if (md->noteol) MRRETURN(MATCH_NOMATCH); |
| 1690 |
if (!md->endonly) goto ASSERT_NL_OR_EOS; |
SCHECK_PARTIAL(); |
| 1691 |
} |
} |
| 1692 |
|
ecode++; |
| 1693 |
|
break; |
| 1694 |
|
|
| 1695 |
|
/* Not multiline mode: assert before a terminating newline or before end of |
| 1696 |
|
subject unless noteol is set. */ |
| 1697 |
|
|
| 1698 |
|
case OP_DOLL: |
| 1699 |
|
if (md->noteol) MRRETURN(MATCH_NOMATCH); |
| 1700 |
|
if (!md->endonly) goto ASSERT_NL_OR_EOS; |
| 1701 |
|
|
| 1702 |
/* ... else fall through for endonly */ |
/* ... else fall through for endonly */ |
| 1703 |
|
|
| 2234 |
loops). */ |
loops). */ |
| 2235 |
|
|
| 2236 |
case OP_REF: |
case OP_REF: |
| 2237 |
|
case OP_REFI: |
| 2238 |
|
caseless = op == OP_REFI; |
| 2239 |
offset = GET2(ecode, 1) << 1; /* Doubled ref number */ |
offset = GET2(ecode, 1) << 1; /* Doubled ref number */ |
| 2240 |
ecode += 3; |
ecode += 3; |
| 2241 |
|
|
| 2283 |
break; |
break; |
| 2284 |
|
|
| 2285 |
default: /* No repeat follows */ |
default: /* No repeat follows */ |
| 2286 |
if ((length = match_ref(offset, eptr, length, md, ims)) < 0) |
if ((length = match_ref(offset, eptr, length, md, caseless)) < 0) |
| 2287 |
{ |
{ |
| 2288 |
CHECK_PARTIAL(); |
CHECK_PARTIAL(); |
| 2289 |
MRRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 2304 |
for (i = 1; i <= min; i++) |
for (i = 1; i <= min; i++) |
| 2305 |
{ |
{ |
| 2306 |
int slength; |
int slength; |
| 2307 |
if ((slength = match_ref(offset, eptr, length, md, ims)) < 0) |
if ((slength = match_ref(offset, eptr, length, md, caseless)) < 0) |
| 2308 |
{ |
{ |
| 2309 |
CHECK_PARTIAL(); |
CHECK_PARTIAL(); |
| 2310 |
MRRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 2324 |
for (fi = min;; fi++) |
for (fi = min;; fi++) |
| 2325 |
{ |
{ |
| 2326 |
int slength; |
int slength; |
| 2327 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM14); |
RMATCH(eptr, ecode, offset_top, md, eptrb, 0, RM14); |
| 2328 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 2329 |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
| 2330 |
if ((slength = match_ref(offset, eptr, length, md, ims)) < 0) |
if ((slength = match_ref(offset, eptr, length, md, caseless)) < 0) |
| 2331 |
{ |
{ |
| 2332 |
CHECK_PARTIAL(); |
CHECK_PARTIAL(); |
| 2333 |
MRRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 2345 |
for (i = min; i < max; i++) |
for (i = min; i < max; i++) |
| 2346 |
{ |
{ |
| 2347 |
int slength; |
int slength; |
| 2348 |
if ((slength = match_ref(offset, eptr, length, md, ims)) < 0) |
if ((slength = match_ref(offset, eptr, length, md, caseless)) < 0) |
| 2349 |
{ |
{ |
| 2350 |
CHECK_PARTIAL(); |
CHECK_PARTIAL(); |
| 2351 |
break; |
break; |
| 2354 |
} |
} |
| 2355 |
while (eptr >= pp) |
while (eptr >= pp) |
| 2356 |
{ |
{ |
| 2357 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM15); |
RMATCH(eptr, ecode, offset_top, md, eptrb, 0, RM15); |
| 2358 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 2359 |
eptr -= length; |
eptr -= length; |
| 2360 |
} |
} |
| 2464 |
{ |
{ |
| 2465 |
for (fi = min;; fi++) |
for (fi = min;; fi++) |
| 2466 |
{ |
{ |
| 2467 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM16); |
RMATCH(eptr, ecode, offset_top, md, eptrb, 0, RM16); |
| 2468 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 2469 |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
| 2470 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 2489 |
{ |
{ |
| 2490 |
for (fi = min;; fi++) |
for (fi = min;; fi++) |
| 2491 |
{ |
{ |
| 2492 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM17); |
RMATCH(eptr, ecode, offset_top, md, eptrb, 0, RM17); |
| 2493 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 2494 |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
| 2495 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 2535 |
} |
} |
| 2536 |
for (;;) |
for (;;) |
| 2537 |
{ |
{ |
| 2538 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM18); |
RMATCH(eptr, ecode, offset_top, md, eptrb, 0, RM18); |
| 2539 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 2540 |
if (eptr-- == pp) break; /* Stop if tried at original pos */ |
if (eptr-- == pp) break; /* Stop if tried at original pos */ |
| 2541 |
BACKCHAR(eptr); |
BACKCHAR(eptr); |
| 2558 |
} |
} |
| 2559 |
while (eptr >= pp) |
while (eptr >= pp) |
| 2560 |
{ |
{ |
| 2561 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM19); |
RMATCH(eptr, ecode, offset_top, md, eptrb, 0, RM19); |
| 2562 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 2563 |
eptr--; |
eptr--; |
| 2564 |
} |
} |
| 2634 |
{ |
{ |
| 2635 |
for (fi = min;; fi++) |
for (fi = min;; fi++) |
| 2636 |
{ |
{ |
| 2637 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM20); |
RMATCH(eptr, ecode, offset_top, md, eptrb, 0, RM20); |
| 2638 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 2639 |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
| 2640 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 2667 |
} |
} |
| 2668 |
for(;;) |
for(;;) |
| 2669 |
{ |
{ |
| 2670 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM21); |
RMATCH(eptr, ecode, offset_top, md, eptrb, 0, RM21); |
| 2671 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 2672 |
if (eptr-- == pp) break; /* Stop if tried at original pos */ |
if (eptr-- == pp) break; /* Stop if tried at original pos */ |
| 2673 |
if (utf8) BACKCHAR(eptr); |
if (utf8) BACKCHAR(eptr); |
| 2712 |
|
|
| 2713 |
/* Match a single character, caselessly */ |
/* Match a single character, caselessly */ |
| 2714 |
|
|
| 2715 |
case OP_CHARNC: |
case OP_CHARI: |
| 2716 |
#ifdef SUPPORT_UTF8 |
#ifdef SUPPORT_UTF8 |
| 2717 |
if (utf8) |
if (utf8) |
| 2718 |
{ |
{ |
| 2772 |
/* Match a single character repeatedly. */ |
/* Match a single character repeatedly. */ |
| 2773 |
|
|
| 2774 |
case OP_EXACT: |
case OP_EXACT: |
| 2775 |
|
case OP_EXACTI: |
| 2776 |
min = max = GET2(ecode, 1); |
min = max = GET2(ecode, 1); |
| 2777 |
ecode += 3; |
ecode += 3; |
| 2778 |
goto REPEATCHAR; |
goto REPEATCHAR; |
| 2779 |
|
|
| 2780 |
case OP_POSUPTO: |
case OP_POSUPTO: |
| 2781 |
|
case OP_POSUPTOI: |
| 2782 |
possessive = TRUE; |
possessive = TRUE; |
| 2783 |
/* Fall through */ |
/* Fall through */ |
| 2784 |
|
|
| 2785 |
case OP_UPTO: |
case OP_UPTO: |
| 2786 |
|
case OP_UPTOI: |
| 2787 |
case OP_MINUPTO: |
case OP_MINUPTO: |
| 2788 |
|
case OP_MINUPTOI: |
| 2789 |
min = 0; |
min = 0; |
| 2790 |
max = GET2(ecode, 1); |
max = GET2(ecode, 1); |
| 2791 |
minimize = *ecode == OP_MINUPTO; |
minimize = *ecode == OP_MINUPTO || *ecode == OP_MINUPTOI; |
| 2792 |
ecode += 3; |
ecode += 3; |
| 2793 |
goto REPEATCHAR; |
goto REPEATCHAR; |
| 2794 |
|
|
| 2795 |
case OP_POSSTAR: |
case OP_POSSTAR: |
| 2796 |
|
case OP_POSSTARI: |
| 2797 |
possessive = TRUE; |
possessive = TRUE; |
| 2798 |
min = 0; |
min = 0; |
| 2799 |
max = INT_MAX; |
max = INT_MAX; |
| 2801 |
goto REPEATCHAR; |
goto REPEATCHAR; |
| 2802 |
|
|
| 2803 |
case OP_POSPLUS: |
case OP_POSPLUS: |
| 2804 |
|
case OP_POSPLUSI: |
| 2805 |
possessive = TRUE; |
possessive = TRUE; |
| 2806 |
min = 1; |
min = 1; |
| 2807 |
max = INT_MAX; |
max = INT_MAX; |
| 2809 |
goto REPEATCHAR; |
goto REPEATCHAR; |
| 2810 |
|
|
| 2811 |
case OP_POSQUERY: |
case OP_POSQUERY: |
| 2812 |
|
case OP_POSQUERYI: |
| 2813 |
possessive = TRUE; |
possessive = TRUE; |
| 2814 |
min = 0; |
min = 0; |
| 2815 |
max = 1; |
max = 1; |
| 2817 |
goto REPEATCHAR; |
goto REPEATCHAR; |
| 2818 |
|
|
| 2819 |
case OP_STAR: |
case OP_STAR: |
| 2820 |
|
case OP_STARI: |
| 2821 |
case OP_MINSTAR: |
case OP_MINSTAR: |
| 2822 |
|
case OP_MINSTARI: |
| 2823 |
case OP_PLUS: |
case OP_PLUS: |
| 2824 |
|
case OP_PLUSI: |
| 2825 |
case OP_MINPLUS: |
case OP_MINPLUS: |
| 2826 |
|
case OP_MINPLUSI: |
| 2827 |
case OP_QUERY: |
case OP_QUERY: |
| 2828 |
|
case OP_QUERYI: |
| 2829 |
case OP_MINQUERY: |
case OP_MINQUERY: |
| 2830 |
c = *ecode++ - OP_STAR; |
case OP_MINQUERYI: |
| 2831 |
|
c = *ecode++ - ((op < OP_STARI)? OP_STAR : OP_STARI); |
| 2832 |
minimize = (c & 1) != 0; |
minimize = (c & 1) != 0; |
|
|
|
| 2833 |
min = rep_min[c]; /* Pick up values from tables; */ |
min = rep_min[c]; /* Pick up values from tables; */ |
| 2834 |
max = rep_max[c]; /* zero for max => infinity */ |
max = rep_max[c]; /* zero for max => infinity */ |
| 2835 |
if (max == 0) max = INT_MAX; |
if (max == 0) max = INT_MAX; |
| 2852 |
{ |
{ |
| 2853 |
#ifdef SUPPORT_UCP |
#ifdef SUPPORT_UCP |
| 2854 |
unsigned int othercase; |
unsigned int othercase; |
| 2855 |
if ((ims & PCRE_CASELESS) != 0 && |
if (op >= OP_STARI && /* Caseless */ |
| 2856 |
(othercase = UCD_OTHERCASE(fc)) != fc) |
(othercase = UCD_OTHERCASE(fc)) != fc) |
| 2857 |
oclength = _pcre_ord2utf8(othercase, occhars); |
oclength = _pcre_ord2utf8(othercase, occhars); |
| 2858 |
else oclength = 0; |
else oclength = 0; |
| 2880 |
{ |
{ |
| 2881 |
for (fi = min;; fi++) |
for (fi = min;; fi++) |
| 2882 |
{ |
{ |
| 2883 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM22); |
RMATCH(eptr, ecode, offset_top, md, eptrb, 0, RM22); |
| 2884 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 2885 |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
| 2886 |
if (eptr <= md->end_subject - length && |
if (eptr <= md->end_subject - length && |
| 2922 |
|
|
| 2923 |
for(;;) |
for(;;) |
| 2924 |
{ |
{ |
| 2925 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM23); |
RMATCH(eptr, ecode, offset_top, md, eptrb, 0, RM23); |
| 2926 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 2927 |
if (eptr == pp) { MRRETURN(MATCH_NOMATCH); } |
if (eptr == pp) { MRRETURN(MATCH_NOMATCH); } |
| 2928 |
#ifdef SUPPORT_UCP |
#ifdef SUPPORT_UCP |
| 2959 |
DPRINTF(("matching %c{%d,%d} against subject %.*s\n", fc, min, max, |
DPRINTF(("matching %c{%d,%d} against subject %.*s\n", fc, min, max, |
| 2960 |
max, eptr)); |
max, eptr)); |
| 2961 |
|
|
| 2962 |
if ((ims & PCRE_CASELESS) != 0) |
if (op >= OP_STARI) /* Caseless */ |
| 2963 |
{ |
{ |
| 2964 |
fc = md->lcc[fc]; |
fc = md->lcc[fc]; |
| 2965 |
for (i = 1; i <= min; i++) |
for (i = 1; i <= min; i++) |
| 2976 |
{ |
{ |
| 2977 |
for (fi = min;; fi++) |
for (fi = min;; fi++) |
| 2978 |
{ |
{ |
| 2979 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM24); |
RMATCH(eptr, ecode, offset_top, md, eptrb, 0, RM24); |
| 2980 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 2981 |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
| 2982 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 3006 |
|
|
| 3007 |
while (eptr >= pp) |
while (eptr >= pp) |
| 3008 |
{ |
{ |
| 3009 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM25); |
RMATCH(eptr, ecode, offset_top, md, eptrb, 0, RM25); |
| 3010 |
eptr--; |
eptr--; |
| 3011 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 3012 |
} |
} |
| 3035 |
{ |
{ |
| 3036 |
for (fi = min;; fi++) |
for (fi = min;; fi++) |
| 3037 |
{ |
{ |
| 3038 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM26); |
RMATCH(eptr, ecode, offset_top, md, eptrb, 0, RM26); |
| 3039 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 3040 |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
| 3041 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 3064 |
|
|
| 3065 |
while (eptr >= pp) |
while (eptr >= pp) |
| 3066 |
{ |
{ |
| 3067 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM27); |
RMATCH(eptr, ecode, offset_top, md, eptrb, 0, RM27); |
| 3068 |
eptr--; |
eptr--; |
| 3069 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 3070 |
} |
} |
| 3077 |
checking can be multibyte. */ |
checking can be multibyte. */ |
| 3078 |
|
|
| 3079 |
case OP_NOT: |
case OP_NOT: |
| 3080 |
|
case OP_NOTI: |
| 3081 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 3082 |
{ |
{ |
| 3083 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 3085 |
} |
} |
| 3086 |
ecode++; |
ecode++; |
| 3087 |
GETCHARINCTEST(c, eptr); |
GETCHARINCTEST(c, eptr); |
| 3088 |
if ((ims & PCRE_CASELESS) != 0) |
if (op == OP_NOTI) /* The caseless case */ |
| 3089 |
{ |
{ |
| 3090 |
#ifdef SUPPORT_UTF8 |
#ifdef SUPPORT_UTF8 |
| 3091 |
if (c < 256) |
if (c < 256) |
| 3093 |
c = md->lcc[c]; |
c = md->lcc[c]; |
| 3094 |
if (md->lcc[*ecode++] == c) MRRETURN(MATCH_NOMATCH); |
if (md->lcc[*ecode++] == c) MRRETURN(MATCH_NOMATCH); |
| 3095 |
} |
} |
| 3096 |
else |
else /* Caseful */ |
| 3097 |
{ |
{ |
| 3098 |
if (*ecode++ == c) MRRETURN(MATCH_NOMATCH); |
if (*ecode++ == c) MRRETURN(MATCH_NOMATCH); |
| 3099 |
} |
} |
| 3107 |
about... */ |
about... */ |
| 3108 |
|
|
| 3109 |
case OP_NOTEXACT: |
case OP_NOTEXACT: |
| 3110 |
|
case OP_NOTEXACTI: |
| 3111 |
min = max = GET2(ecode, 1); |
min = max = GET2(ecode, 1); |
| 3112 |
ecode += 3; |
ecode += 3; |
| 3113 |
goto REPEATNOTCHAR; |
goto REPEATNOTCHAR; |
| 3114 |
|
|
| 3115 |
case OP_NOTUPTO: |
case OP_NOTUPTO: |
| 3116 |
|
case OP_NOTUPTOI: |
| 3117 |
case OP_NOTMINUPTO: |
case OP_NOTMINUPTO: |
| 3118 |
|
case OP_NOTMINUPTOI: |
| 3119 |
min = 0; |
min = 0; |
| 3120 |
max = GET2(ecode, 1); |
max = GET2(ecode, 1); |
| 3121 |
minimize = *ecode == OP_NOTMINUPTO; |
minimize = *ecode == OP_NOTMINUPTO || *ecode == OP_NOTMINUPTOI; |
| 3122 |
ecode += 3; |
ecode += 3; |
| 3123 |
goto REPEATNOTCHAR; |
goto REPEATNOTCHAR; |
| 3124 |
|
|
| 3125 |
case OP_NOTPOSSTAR: |
case OP_NOTPOSSTAR: |
| 3126 |
|
case OP_NOTPOSSTARI: |
| 3127 |
possessive = TRUE; |
possessive = TRUE; |
| 3128 |
min = 0; |
min = 0; |
| 3129 |
max = INT_MAX; |
max = INT_MAX; |
| 3131 |
goto REPEATNOTCHAR; |
goto REPEATNOTCHAR; |
| 3132 |
|
|
| 3133 |
case OP_NOTPOSPLUS: |
case OP_NOTPOSPLUS: |
| 3134 |
|
case OP_NOTPOSPLUSI: |
| 3135 |
possessive = TRUE; |
possessive = TRUE; |
| 3136 |
min = 1; |
min = 1; |
| 3137 |
max = INT_MAX; |
max = INT_MAX; |
| 3139 |
goto REPEATNOTCHAR; |
goto REPEATNOTCHAR; |
| 3140 |
|
|
| 3141 |
case OP_NOTPOSQUERY: |
case OP_NOTPOSQUERY: |
| 3142 |
|
case OP_NOTPOSQUERYI: |
| 3143 |
possessive = TRUE; |
possessive = TRUE; |
| 3144 |
min = 0; |
min = 0; |
| 3145 |
max = 1; |
max = 1; |
| 3147 |
goto REPEATNOTCHAR; |
goto REPEATNOTCHAR; |
| 3148 |
|
|
| 3149 |
case OP_NOTPOSUPTO: |
case OP_NOTPOSUPTO: |
| 3150 |
|
case OP_NOTPOSUPTOI: |
| 3151 |
possessive = TRUE; |
possessive = TRUE; |
| 3152 |
min = 0; |
min = 0; |
| 3153 |
max = GET2(ecode, 1); |
max = GET2(ecode, 1); |
| 3155 |
goto REPEATNOTCHAR; |
goto REPEATNOTCHAR; |
| 3156 |
|
|
| 3157 |
case OP_NOTSTAR: |
case OP_NOTSTAR: |
| 3158 |
|
case OP_NOTSTARI: |
| 3159 |
case OP_NOTMINSTAR: |
case OP_NOTMINSTAR: |
| 3160 |
|
case OP_NOTMINSTARI: |
| 3161 |
case OP_NOTPLUS: |
case OP_NOTPLUS: |
| 3162 |
|
case OP_NOTPLUSI: |
| 3163 |
case OP_NOTMINPLUS: |
case OP_NOTMINPLUS: |
| 3164 |
|
case OP_NOTMINPLUSI: |
| 3165 |
case OP_NOTQUERY: |
case OP_NOTQUERY: |
| 3166 |
|
case OP_NOTQUERYI: |
| 3167 |
case OP_NOTMINQUERY: |
case OP_NOTMINQUERY: |
| 3168 |
c = *ecode++ - OP_NOTSTAR; |
case OP_NOTMINQUERYI: |
| 3169 |
|
c = *ecode++ - ((op >= OP_NOTSTARI)? OP_NOTSTARI: OP_NOTSTAR); |
| 3170 |
minimize = (c & 1) != 0; |
minimize = (c & 1) != 0; |
| 3171 |
min = rep_min[c]; /* Pick up values from tables; */ |
min = rep_min[c]; /* Pick up values from tables; */ |
| 3172 |
max = rep_max[c]; /* zero for max => infinity */ |
max = rep_max[c]; /* zero for max => infinity */ |
| 3188 |
DPRINTF(("negative matching %c{%d,%d} against subject %.*s\n", fc, min, max, |
DPRINTF(("negative matching %c{%d,%d} against subject %.*s\n", fc, min, max, |
| 3189 |
max, eptr)); |
max, eptr)); |
| 3190 |
|
|
| 3191 |
if ((ims & PCRE_CASELESS) != 0) |
if (op >= OP_NOTSTARI) /* Caseless */ |
| 3192 |
{ |
{ |
| 3193 |
fc = md->lcc[fc]; |
fc = md->lcc[fc]; |
| 3194 |
|
|
| 3236 |
register unsigned int d; |
register unsigned int d; |
| 3237 |
for (fi = min;; fi++) |
for (fi = min;; fi++) |
| 3238 |
{ |
{ |
| 3239 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM28); |
RMATCH(eptr, ecode, offset_top, md, eptrb, 0, RM28); |
| 3240 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 3241 |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
| 3242 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 3255 |
{ |
{ |
| 3256 |
for (fi = min;; fi++) |
for (fi = min;; fi++) |
| 3257 |
{ |
{ |
| 3258 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM29); |
RMATCH(eptr, ecode, offset_top, md, eptrb, 0, RM29); |
| 3259 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 3260 |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
| 3261 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 3296 |
if (possessive) continue; |
if (possessive) continue; |
| 3297 |
for(;;) |
for(;;) |
| 3298 |
{ |
{ |
| 3299 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM30); |
RMATCH(eptr, ecode, offset_top, md, eptrb, 0, RM30); |
| 3300 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 3301 |
if (eptr-- == pp) break; /* Stop if tried at original pos */ |
if (eptr-- == pp) break; /* Stop if tried at original pos */ |
| 3302 |
BACKCHAR(eptr); |
BACKCHAR(eptr); |
| 3319 |
if (possessive) continue; |
if (possessive) continue; |
| 3320 |
while (eptr >= pp) |
while (eptr >= pp) |
| 3321 |
{ |
{ |
| 3322 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM31); |
RMATCH(eptr, ecode, offset_top, md, eptrb, 0, RM31); |
| 3323 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 3324 |
eptr--; |
eptr--; |
| 3325 |
} |
} |
| 3376 |
register unsigned int d; |
register unsigned int d; |
| 3377 |
for (fi = min;; fi++) |
for (fi = min;; fi++) |
| 3378 |
{ |
{ |
| 3379 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM32); |
RMATCH(eptr, ecode, offset_top, md, eptrb, 0, RM32); |
| 3380 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 3381 |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
| 3382 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 3394 |
{ |
{ |
| 3395 |
for (fi = min;; fi++) |
for (fi = min;; fi++) |
| 3396 |
{ |
{ |
| 3397 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM33); |
RMATCH(eptr, ecode, offset_top, md, eptrb, 0, RM33); |
| 3398 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 3399 |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
| 3400 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 3434 |
if (possessive) continue; |
if (possessive) continue; |
| 3435 |
for(;;) |
for(;;) |
| 3436 |
{ |
{ |
| 3437 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM34); |
RMATCH(eptr, ecode, offset_top, md, eptrb, 0, RM34); |
| 3438 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 3439 |
if (eptr-- == pp) break; /* Stop if tried at original pos */ |
if (eptr-- == pp) break; /* Stop if tried at original pos */ |
| 3440 |
BACKCHAR(eptr); |
BACKCHAR(eptr); |
| 3457 |
if (possessive) continue; |
if (possessive) continue; |
| 3458 |
while (eptr >= pp) |
while (eptr >= pp) |
| 3459 |
{ |
{ |
| 3460 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM35); |
RMATCH(eptr, ecode, offset_top, md, eptrb, 0, RM35); |
| 3461 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 3462 |
eptr--; |
eptr--; |
| 3463 |
} |
} |
| 4255 |
case PT_ANY: |
case PT_ANY: |
| 4256 |
for (fi = min;; fi++) |
for (fi = min;; fi++) |
| 4257 |
{ |
{ |
| 4258 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM36); |
RMATCH(eptr, ecode, offset_top, md, eptrb, 0, RM36); |
| 4259 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 4260 |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
| 4261 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 4271 |
case PT_LAMP: |
case PT_LAMP: |
| 4272 |
for (fi = min;; fi++) |
for (fi = min;; fi++) |
| 4273 |
{ |
{ |
| 4274 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM37); |
RMATCH(eptr, ecode, offset_top, md, eptrb, 0, RM37); |
| 4275 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 4276 |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
| 4277 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 4291 |
case PT_GC: |
case PT_GC: |
| 4292 |
for (fi = min;; fi++) |
for (fi = min;; fi++) |
| 4293 |
{ |
{ |
| 4294 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM38); |
RMATCH(eptr, ecode, offset_top, md, eptrb, 0, RM38); |
| 4295 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 4296 |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
| 4297 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 4309 |
case PT_PC: |
case PT_PC: |
| 4310 |
for (fi = min;; fi++) |
for (fi = min;; fi++) |
| 4311 |
{ |
{ |
| 4312 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM39); |
RMATCH(eptr, ecode, offset_top, md, eptrb, 0, RM39); |
| 4313 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 4314 |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
| 4315 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 4327 |
case PT_SC: |
case PT_SC: |
| 4328 |
for (fi = min;; fi++) |
for (fi = min;; fi++) |
| 4329 |
{ |
{ |
| 4330 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM40); |
RMATCH(eptr, ecode, offset_top, md, eptrb, 0, RM40); |
| 4331 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 4332 |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
| 4333 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 4345 |
case PT_ALNUM: |
case PT_ALNUM: |
| 4346 |
for (fi = min;; fi++) |
for (fi = min;; fi++) |
| 4347 |
{ |
{ |
| 4348 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM59); |
RMATCH(eptr, ecode, offset_top, md, eptrb, 0, RM59); |
| 4349 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 4350 |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
| 4351 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 4364 |
case PT_SPACE: /* Perl space */ |
case PT_SPACE: /* Perl space */ |
| 4365 |
for (fi = min;; fi++) |
for (fi = min;; fi++) |
| 4366 |
{ |
{ |
| 4367 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM60); |
RMATCH(eptr, ecode, offset_top, md, eptrb, 0, RM60); |
| 4368 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 4369 |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
| 4370 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 4384 |
case PT_PXSPACE: /* POSIX space */ |
case PT_PXSPACE: /* POSIX space */ |
| 4385 |
for (fi = min;; fi++) |
for (fi = min;; fi++) |
| 4386 |
{ |
{ |
| 4387 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM61); |
RMATCH(eptr, ecode, offset_top, md, eptrb, 0, RM61); |
| 4388 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 4389 |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
| 4390 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 4404 |
case PT_WORD: |
case PT_WORD: |
| 4405 |
for (fi = min;; fi++) |
for (fi = min;; fi++) |
| 4406 |
{ |
{ |
| 4407 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM62); |
RMATCH(eptr, ecode, offset_top, md, eptrb, 0, RM62); |
| 4408 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 4409 |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
| 4410 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 4436 |
{ |
{ |
| 4437 |
for (fi = min;; fi++) |
for (fi = min;; fi++) |
| 4438 |
{ |
{ |
| 4439 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM41); |
RMATCH(eptr, ecode, offset_top, md, eptrb, 0, RM41); |
| 4440 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 4441 |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
| 4442 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 4468 |
{ |
{ |
| 4469 |
for (fi = min;; fi++) |
for (fi = min;; fi++) |
| 4470 |
{ |
{ |
| 4471 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM42); |
RMATCH(eptr, ecode, offset_top, md, eptrb, 0, RM42); |
| 4472 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 4473 |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
| 4474 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 4631 |
{ |
{ |
| 4632 |
for (fi = min;; fi++) |
for (fi = min;; fi++) |
| 4633 |
{ |
{ |
| 4634 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM43); |
RMATCH(eptr, ecode, offset_top, md, eptrb, 0, RM43); |
| 4635 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 4636 |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
| 4637 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 4929 |
if (possessive) continue; |
if (possessive) continue; |
| 4930 |
for(;;) |
for(;;) |
| 4931 |
{ |
{ |
| 4932 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM44); |
RMATCH(eptr, ecode, offset_top, md, eptrb, 0, RM44); |
| 4933 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 4934 |
if (eptr-- == pp) break; /* Stop if tried at original pos */ |
if (eptr-- == pp) break; /* Stop if tried at original pos */ |
| 4935 |
if (utf8) BACKCHAR(eptr); |
if (utf8) BACKCHAR(eptr); |
| 4970 |
|
|
| 4971 |
for(;;) |
for(;;) |
| 4972 |
{ |
{ |
| 4973 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM45); |
RMATCH(eptr, ecode, offset_top, md, eptrb, 0, RM45); |
| 4974 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 4975 |
if (eptr-- == pp) break; /* Stop if tried at original pos */ |
if (eptr-- == pp) break; /* Stop if tried at original pos */ |
| 4976 |
for (;;) /* Move back over one extended */ |
for (;;) /* Move back over one extended */ |
| 5263 |
if (possessive) continue; |
if (possessive) continue; |
| 5264 |
for(;;) |
for(;;) |
| 5265 |
{ |
{ |
| 5266 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM46); |
RMATCH(eptr, ecode, offset_top, md, eptrb, 0, RM46); |
| 5267 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 5268 |
if (eptr-- == pp) break; /* Stop if tried at original pos */ |
if (eptr-- == pp) break; /* Stop if tried at original pos */ |
| 5269 |
BACKCHAR(eptr); |
BACKCHAR(eptr); |
| 5476 |
if (possessive) continue; |
if (possessive) continue; |
| 5477 |
while (eptr >= pp) |
while (eptr >= pp) |
| 5478 |
{ |
{ |
| 5479 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM47); |
RMATCH(eptr, ecode, offset_top, md, eptrb, 0, RM47); |
| 5480 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 5481 |
eptr--; |
eptr--; |
| 5482 |
if (ctype == OP_ANYNL && eptr > pp && *eptr == '\n' && |
if (ctype == OP_ANYNL && eptr > pp && *eptr == '\n' && |
| 5548 |
#undef ecode |
#undef ecode |
| 5549 |
#undef mstart |
#undef mstart |
| 5550 |
#undef offset_top |
#undef offset_top |
|
#undef ims |
|
| 5551 |
#undef eptrb |
#undef eptrb |
| 5552 |
#undef flags |
#undef flags |
| 5553 |
|
|
| 5565 |
#undef condition |
#undef condition |
| 5566 |
#undef prev_is_word |
#undef prev_is_word |
| 5567 |
|
|
|
#undef original_ims |
|
|
|
|
| 5568 |
#undef ctype |
#undef ctype |
| 5569 |
#undef length |
#undef length |
| 5570 |
#undef max |
#undef max |
| 5626 |
int req_byte = -1; |
int req_byte = -1; |
| 5627 |
int req_byte2 = -1; |
int req_byte2 = -1; |
| 5628 |
int newline; |
int newline; |
|
unsigned long int ims; |
|
| 5629 |
BOOL using_temporary_offsets = FALSE; |
BOOL using_temporary_offsets = FALSE; |
| 5630 |
BOOL anchored; |
BOOL anchored; |
| 5631 |
BOOL startline; |
BOOL startline; |
| 5842 |
} |
} |
| 5843 |
#endif |
#endif |
| 5844 |
|
|
|
/* The ims options can vary during the matching as a result of the presence |
|
|
of (?ims) items in the pattern. They are kept in a local variable so that |
|
|
restoring at the exit of a group is easy. */ |
|
|
|
|
|
ims = re->options & (PCRE_CASELESS|PCRE_MULTILINE|PCRE_DOTALL); |
|
|
|
|
| 5845 |
/* If the expression has got more back references than the offsets supplied can |
/* If the expression has got more back references than the offsets supplied can |
| 5846 |
hold, we get a temporary chunk of working store to use during the matching. |
hold, we get a temporary chunk of working store to use during the matching. |
| 5847 |
Otherwise, we can use the vector supplied, rounding down its size to a multiple |
Otherwise, we can use the vector supplied, rounding down its size to a multiple |
| 6120 |
md->start_match_ptr = start_match; |
md->start_match_ptr = start_match; |
| 6121 |
md->start_used_ptr = start_match; |
md->start_used_ptr = start_match; |
| 6122 |
md->match_call_count = 0; |
md->match_call_count = 0; |
| 6123 |
rc = match(start_match, md->start_code, start_match, NULL, 2, md, ims, NULL, |
rc = match(start_match, md->start_code, start_match, NULL, 2, md, NULL, |
| 6124 |
0, 0); |
0, 0); |
| 6125 |
if (md->hitend && start_partial == NULL) start_partial = md->start_used_ptr; |
if (md->hitend && start_partial == NULL) start_partial = md->start_used_ptr; |
| 6126 |
|
|