Changeset 28157 in webkit for trunk/JavaScriptCore/pcre/pcre_exec.cpp
- Timestamp:
- Nov 29, 2007, 3:20:26 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/pcre/pcre_exec.cpp
r28156 r28157 82 82 83 83 struct MatchFrame { 84 ReturnLocation returnLocation; 85 86 struct MatchFrame* previousFrame; 87 88 /* Function arguments that may change */ 89 90 UChar* eptr; 91 const uschar* ecode; 92 int offset_top; 93 eptrblock* eptrb; 94 95 /* Function local variables */ 96 97 const uschar* data; 98 const uschar* next; 99 const UChar* pp; 100 const uschar* prev; 101 const UChar* saved_eptr; 102 103 int repeat_othercase; 104 105 int ctype; 106 int fc; 107 int fi; 108 int length; 109 int max; 110 int number; 111 int offset; 112 int save_offset1, save_offset2, save_offset3; 113 114 eptrblock newptrb; 84 ReturnLocation returnLocation; 85 86 struct MatchFrame* previousFrame; 87 88 /* Function arguments that may change */ 89 90 struct { 91 UChar* eptr; 92 const uschar* ecode; 93 int offset_top; 94 eptrblock* eptrb; 95 } args; 96 97 98 /* Because PCRE uses "fake" recursion built off of gotos, 99 stack-based local variables are not safe to use, we have to instead 100 store variables off of the current MatchFrame. 101 The rest of this structure consists of such variables: */ 102 103 const uschar* data; 104 const uschar* next; 105 const UChar* pp; 106 const uschar* prev; 107 const UChar* saved_eptr; 108 109 int repeat_othercase; 110 111 int ctype; 112 int fc; 113 int fi; 114 int length; 115 int max; 116 int number; 117 int offset; 118 int save_offset1; 119 int save_offset2; 120 int save_offset3; 121 122 eptrblock newptrb; 115 123 }; 116 124 … … 352 360 newframe->previousFrame = currentFrame; 353 361 354 newframe-> eptr = currentFrame->eptr;355 newframe-> offset_top = currentFrame->offset_top;356 newframe-> ecode = ecode;357 newframe-> eptrb = eptrb;362 newframe->args.eptr = currentFrame->args.eptr; 363 newframe->args.offset_top = currentFrame->args.offset_top; 364 newframe->args.ecode = ecode; 365 newframe->args.eptrb = eptrb; 358 366 newframe->returnLocation = returnLocation; 359 367 … … 444 452 #endif 445 453 446 stack.currentFrame-> eptr = eptr;447 stack.currentFrame-> ecode = ecode;448 stack.currentFrame-> offset_top = offset_top;449 stack.currentFrame-> eptrb = NULL;454 stack.currentFrame->args.eptr = eptr; 455 stack.currentFrame->args.ecode = ecode; 456 stack.currentFrame->args.offset_top = offset_top; 457 stack.currentFrame->args.eptrb = NULL; 450 458 451 459 /* This is where control jumps back to to effect "recursion" */ … … 475 483 476 484 if (is_group_start) { 477 stack.currentFrame->newptrb.epb_prev = stack.currentFrame-> eptrb;478 stack.currentFrame->newptrb.epb_saved_eptr = stack.currentFrame-> eptr;479 stack.currentFrame-> eptrb = &stack.currentFrame->newptrb;485 stack.currentFrame->newptrb.epb_prev = stack.currentFrame->args.eptrb; 486 stack.currentFrame->newptrb.epb_saved_eptr = stack.currentFrame->args.eptr; 487 stack.currentFrame->args.eptrb = &stack.currentFrame->newptrb; 480 488 } 481 489 … … 489 497 #ifdef USE_COMPUTED_GOTO_FOR_MATCH_OPCODE_LOOP 490 498 #define BEGIN_OPCODE(opcode) LABEL_OP_##opcode 491 #define NEXT_OPCODE goto *opcode_jump_table[*stack.currentFrame-> ecode]499 #define NEXT_OPCODE goto *opcode_jump_table[*stack.currentFrame->args.ecode] 492 500 #else 493 501 #define BEGIN_OPCODE(opcode) case OP_##opcode … … 498 506 NEXT_OPCODE; 499 507 #else 500 switch (*stack.currentFrame-> ecode)508 switch (*stack.currentFrame->args.ecode) 501 509 #endif 502 510 { … … 507 515 DPRINTF(("start bracket 0\n")); 508 516 do { 509 RMATCH(2, stack.currentFrame-> ecode + 1 + LINK_SIZE, stack.currentFrame->eptrb, match_isgroup);517 RMATCH(2, stack.currentFrame->args.ecode + 1 + LINK_SIZE, stack.currentFrame->args.eptrb, match_isgroup); 510 518 if (is_match) 511 519 RRETURN; 512 stack.currentFrame-> ecode += GET(stack.currentFrame->ecode, 1);513 } while (*stack.currentFrame-> ecode == OP_ALT);520 stack.currentFrame->args.ecode += GET(stack.currentFrame->args.ecode, 1); 521 } while (*stack.currentFrame->args.ecode == OP_ALT); 514 522 DPRINTF(("bracket 0 failed\n")); 515 523 RRETURN; … … 518 526 519 527 BEGIN_OPCODE(BRANUMBER): 520 stack.currentFrame-> ecode += 3;528 stack.currentFrame->args.ecode += 3; 521 529 NEXT_OPCODE; 522 530 … … 524 532 525 533 BEGIN_OPCODE(END): 526 md.end_match_ptr = stack.currentFrame-> eptr; /* Record where we ended */527 md.end_offset_top = stack.currentFrame-> offset_top; /* and how many extracts were taken */534 md.end_match_ptr = stack.currentFrame->args.eptr; /* Record where we ended */ 535 md.end_offset_top = stack.currentFrame->args.offset_top; /* and how many extracts were taken */ 528 536 is_match = true; 529 537 RRETURN; … … 537 545 BEGIN_OPCODE(ASSERT): 538 546 do { 539 RMATCH(6, stack.currentFrame-> ecode + 1 + LINK_SIZE, NULL, match_isgroup);547 RMATCH(6, stack.currentFrame->args.ecode + 1 + LINK_SIZE, NULL, match_isgroup); 540 548 if (is_match) 541 549 break; 542 stack.currentFrame-> ecode += GET(stack.currentFrame->ecode, 1);543 } while (*stack.currentFrame-> ecode == OP_ALT);544 if (*stack.currentFrame-> ecode == OP_KET)550 stack.currentFrame->args.ecode += GET(stack.currentFrame->args.ecode, 1); 551 } while (*stack.currentFrame->args.ecode == OP_ALT); 552 if (*stack.currentFrame->args.ecode == OP_KET) 545 553 RRETURN_NO_MATCH; 546 554 … … 548 556 mark, since extracts may have been taken during the assertion. */ 549 557 550 do stack.currentFrame-> ecode += GET(stack.currentFrame->ecode,1); while (*stack.currentFrame->ecode == OP_ALT);551 stack.currentFrame-> ecode += 1 + LINK_SIZE;552 stack.currentFrame-> offset_top = md.end_offset_top;558 do stack.currentFrame->args.ecode += GET(stack.currentFrame->args.ecode,1); while (*stack.currentFrame->args.ecode == OP_ALT); 559 stack.currentFrame->args.ecode += 1 + LINK_SIZE; 560 stack.currentFrame->args.offset_top = md.end_offset_top; 553 561 NEXT_OPCODE; 554 562 … … 557 565 BEGIN_OPCODE(ASSERT_NOT): 558 566 do { 559 RMATCH(7, stack.currentFrame-> ecode + 1 + LINK_SIZE, NULL, match_isgroup);567 RMATCH(7, stack.currentFrame->args.ecode + 1 + LINK_SIZE, NULL, match_isgroup); 560 568 if (is_match) 561 569 RRETURN_NO_MATCH; 562 stack.currentFrame-> ecode += GET(stack.currentFrame->ecode,1);563 } while (*stack.currentFrame-> ecode == OP_ALT);564 565 stack.currentFrame-> ecode += 1 + LINK_SIZE;570 stack.currentFrame->args.ecode += GET(stack.currentFrame->args.ecode,1); 571 } while (*stack.currentFrame->args.ecode == OP_ALT); 572 573 stack.currentFrame->args.ecode += 1 + LINK_SIZE; 566 574 NEXT_OPCODE; 567 575 … … 574 582 575 583 BEGIN_OPCODE(ONCE): 576 stack.currentFrame->prev = stack.currentFrame-> ecode;577 stack.currentFrame->saved_eptr = stack.currentFrame-> eptr;584 stack.currentFrame->prev = stack.currentFrame->args.ecode; 585 stack.currentFrame->saved_eptr = stack.currentFrame->args.eptr; 578 586 579 587 do { 580 RMATCH(9, stack.currentFrame-> ecode + 1 + LINK_SIZE, stack.currentFrame->eptrb, match_isgroup);588 RMATCH(9, stack.currentFrame->args.ecode + 1 + LINK_SIZE, stack.currentFrame->args.eptrb, match_isgroup); 581 589 if (is_match) 582 590 break; 583 stack.currentFrame-> ecode += GET(stack.currentFrame->ecode,1);584 } while (*stack.currentFrame-> ecode == OP_ALT);591 stack.currentFrame->args.ecode += GET(stack.currentFrame->args.ecode,1); 592 } while (*stack.currentFrame->args.ecode == OP_ALT); 585 593 586 594 /* If hit the end of the group (which could be repeated), fail */ 587 595 588 if (*stack.currentFrame-> ecode != OP_ONCE && *stack.currentFrame->ecode != OP_ALT)596 if (*stack.currentFrame->args.ecode != OP_ONCE && *stack.currentFrame->args.ecode != OP_ALT) 589 597 RRETURN; 590 598 … … 592 600 mark, since extracts may have been taken. */ 593 601 594 do stack.currentFrame-> ecode += GET(stack.currentFrame->ecode,1); while (*stack.currentFrame->ecode == OP_ALT);595 596 stack.currentFrame-> offset_top = md.end_offset_top;597 stack.currentFrame-> eptr = md.end_match_ptr;602 do stack.currentFrame->args.ecode += GET(stack.currentFrame->args.ecode,1); while (*stack.currentFrame->args.ecode == OP_ALT); 603 604 stack.currentFrame->args.offset_top = md.end_offset_top; 605 stack.currentFrame->args.eptr = md.end_match_ptr; 598 606 599 607 /* For a non-repeating ket, just continue at this level. This also … … 603 611 course of events. */ 604 612 605 if (*stack.currentFrame-> ecode == OP_KET || stack.currentFrame->eptr == stack.currentFrame->saved_eptr) {606 stack.currentFrame-> ecode += 1+LINK_SIZE;613 if (*stack.currentFrame->args.ecode == OP_KET || stack.currentFrame->args.eptr == stack.currentFrame->saved_eptr) { 614 stack.currentFrame->args.ecode += 1+LINK_SIZE; 607 615 NEXT_OPCODE; 608 616 } … … 613 621 opcode. */ 614 622 615 if (*stack.currentFrame-> ecode == OP_KETRMIN) {616 RMATCH(10, stack.currentFrame-> ecode + 1 + LINK_SIZE, stack.currentFrame->eptrb, 0);623 if (*stack.currentFrame->args.ecode == OP_KETRMIN) { 624 RMATCH(10, stack.currentFrame->args.ecode + 1 + LINK_SIZE, stack.currentFrame->args.eptrb, 0); 617 625 if (is_match) 618 626 RRETURN; 619 RMATCH(11, stack.currentFrame->prev, stack.currentFrame-> eptrb, match_isgroup);627 RMATCH(11, stack.currentFrame->prev, stack.currentFrame->args.eptrb, match_isgroup); 620 628 if (is_match) 621 629 RRETURN; 622 630 } else { /* OP_KETRMAX */ 623 RMATCH(12, stack.currentFrame->prev, stack.currentFrame-> eptrb, match_isgroup);631 RMATCH(12, stack.currentFrame->prev, stack.currentFrame->args.eptrb, match_isgroup); 624 632 if (is_match) 625 633 RRETURN; 626 RMATCH(13, stack.currentFrame-> ecode + 1+LINK_SIZE, stack.currentFrame->eptrb, 0);634 RMATCH(13, stack.currentFrame->args.ecode + 1+LINK_SIZE, stack.currentFrame->args.eptrb, 0); 627 635 if (is_match) 628 636 RRETURN; … … 634 642 635 643 BEGIN_OPCODE(ALT): 636 do stack.currentFrame-> ecode += GET(stack.currentFrame->ecode,1); while (*stack.currentFrame->ecode == OP_ALT);644 do stack.currentFrame->args.ecode += GET(stack.currentFrame->args.ecode,1); while (*stack.currentFrame->args.ecode == OP_ALT); 637 645 NEXT_OPCODE; 638 646 … … 645 653 BEGIN_OPCODE(BRAZERO): 646 654 { 647 stack.currentFrame->next = stack.currentFrame-> ecode+1;648 RMATCH(14, stack.currentFrame->next, stack.currentFrame-> eptrb, match_isgroup);655 stack.currentFrame->next = stack.currentFrame->args.ecode+1; 656 RMATCH(14, stack.currentFrame->next, stack.currentFrame->args.eptrb, match_isgroup); 649 657 if (is_match) 650 658 RRETURN; 651 659 do stack.currentFrame->next += GET(stack.currentFrame->next,1); while (*stack.currentFrame->next == OP_ALT); 652 stack.currentFrame-> ecode = stack.currentFrame->next + 1+LINK_SIZE;660 stack.currentFrame->args.ecode = stack.currentFrame->next + 1+LINK_SIZE; 653 661 } 654 662 NEXT_OPCODE; … … 656 664 BEGIN_OPCODE(BRAMINZERO): 657 665 { 658 stack.currentFrame->next = stack.currentFrame-> ecode+1;666 stack.currentFrame->next = stack.currentFrame->args.ecode+1; 659 667 do stack.currentFrame->next += GET(stack.currentFrame->next,1); while (*stack.currentFrame->next == OP_ALT); 660 RMATCH(15, stack.currentFrame->next + 1+LINK_SIZE, stack.currentFrame-> eptrb, match_isgroup);668 RMATCH(15, stack.currentFrame->next + 1+LINK_SIZE, stack.currentFrame->args.eptrb, match_isgroup); 661 669 if (is_match) 662 670 RRETURN; 663 stack.currentFrame-> ecode++;671 stack.currentFrame->args.ecode++; 664 672 } 665 673 NEXT_OPCODE; … … 673 681 BEGIN_OPCODE(KETRMIN): 674 682 BEGIN_OPCODE(KETRMAX): 675 stack.currentFrame->prev = stack.currentFrame-> ecode - GET(stack.currentFrame->ecode, 1);676 stack.currentFrame->saved_eptr = stack.currentFrame-> eptrb->epb_saved_eptr;683 stack.currentFrame->prev = stack.currentFrame->args.ecode - GET(stack.currentFrame->args.ecode, 1); 684 stack.currentFrame->saved_eptr = stack.currentFrame->args.eptrb->epb_saved_eptr; 677 685 678 686 /* Back up the stack of bracket start pointers. */ 679 687 680 stack.currentFrame-> eptrb = stack.currentFrame->eptrb->epb_prev;688 stack.currentFrame->args.eptrb = stack.currentFrame->args.eptrb->epb_prev; 681 689 682 690 if (*stack.currentFrame->prev == OP_ASSERT || *stack.currentFrame->prev == OP_ASSERT_NOT || *stack.currentFrame->prev == OP_ONCE) { 683 md.end_match_ptr = stack.currentFrame-> eptr; /* For ONCE */684 md.end_offset_top = stack.currentFrame-> offset_top;691 md.end_match_ptr = stack.currentFrame->args.eptr; /* For ONCE */ 692 md.end_offset_top = stack.currentFrame->args.offset_top; 685 693 is_match = true; 686 694 RRETURN; … … 716 724 md.offset_vector[stack.currentFrame->offset] = 717 725 md.offset_vector[md.offset_end - stack.currentFrame->number]; 718 md.offset_vector[stack.currentFrame->offset+1] = stack.currentFrame-> eptr - md.start_subject;719 if (stack.currentFrame-> offset_top <= stack.currentFrame->offset)720 stack.currentFrame-> offset_top = stack.currentFrame->offset + 2;726 md.offset_vector[stack.currentFrame->offset+1] = stack.currentFrame->args.eptr - md.start_subject; 727 if (stack.currentFrame->args.offset_top <= stack.currentFrame->offset) 728 stack.currentFrame->args.offset_top = stack.currentFrame->offset + 2; 721 729 } 722 730 } … … 728 736 course of events. */ 729 737 730 if (*stack.currentFrame-> ecode == OP_KET || stack.currentFrame->eptr == stack.currentFrame->saved_eptr) {731 stack.currentFrame-> ecode += 1 + LINK_SIZE;738 if (*stack.currentFrame->args.ecode == OP_KET || stack.currentFrame->args.eptr == stack.currentFrame->saved_eptr) { 739 stack.currentFrame->args.ecode += 1 + LINK_SIZE; 732 740 NEXT_OPCODE; 733 741 } … … 736 744 preceding bracket, in the appropriate order. */ 737 745 738 if (*stack.currentFrame-> ecode == OP_KETRMIN) {739 RMATCH(16, stack.currentFrame-> ecode + 1+LINK_SIZE, stack.currentFrame->eptrb, 0);746 if (*stack.currentFrame->args.ecode == OP_KETRMIN) { 747 RMATCH(16, stack.currentFrame->args.ecode + 1+LINK_SIZE, stack.currentFrame->args.eptrb, 0); 740 748 if (is_match) 741 749 RRETURN; 742 RMATCH(17, stack.currentFrame->prev, stack.currentFrame-> eptrb, match_isgroup);750 RMATCH(17, stack.currentFrame->prev, stack.currentFrame->args.eptrb, match_isgroup); 743 751 if (is_match) 744 752 RRETURN; 745 753 } else { /* OP_KETRMAX */ 746 RMATCH(18, stack.currentFrame->prev, stack.currentFrame-> eptrb, match_isgroup);754 RMATCH(18, stack.currentFrame->prev, stack.currentFrame->args.eptrb, match_isgroup); 747 755 if (is_match) 748 756 RRETURN; 749 RMATCH(19, stack.currentFrame-> ecode + 1+LINK_SIZE, stack.currentFrame->eptrb, 0);757 RMATCH(19, stack.currentFrame->args.ecode + 1+LINK_SIZE, stack.currentFrame->args.eptrb, 0); 750 758 if (is_match) 751 759 RRETURN; … … 756 764 757 765 BEGIN_OPCODE(CIRC): 758 if (stack.currentFrame-> eptr != md.start_subject && (!md.multiline || !isNewline(stack.currentFrame->eptr[-1])))759 RRETURN_NO_MATCH; 760 stack.currentFrame-> ecode++;766 if (stack.currentFrame->args.eptr != md.start_subject && (!md.multiline || !isNewline(stack.currentFrame->args.eptr[-1]))) 767 RRETURN_NO_MATCH; 768 stack.currentFrame->args.ecode++; 761 769 NEXT_OPCODE; 762 770 … … 764 772 765 773 BEGIN_OPCODE(DOLL): 766 if (stack.currentFrame-> eptr < md.end_subject && (!md.multiline || !isNewline(*stack.currentFrame->eptr)))767 RRETURN_NO_MATCH; 768 stack.currentFrame-> ecode++;774 if (stack.currentFrame->args.eptr < md.end_subject && (!md.multiline || !isNewline(*stack.currentFrame->args.eptr))) 775 RRETURN_NO_MATCH; 776 stack.currentFrame->args.ecode++; 769 777 NEXT_OPCODE; 770 778 … … 777 785 be "non-word" characters. */ 778 786 779 if (stack.currentFrame-> eptr == md.start_subject)787 if (stack.currentFrame->args.eptr == md.start_subject) 780 788 prev_is_word = false; 781 789 else { 782 const UChar* lastptr = stack.currentFrame-> eptr - 1;790 const UChar* lastptr = stack.currentFrame->args.eptr - 1; 783 791 while(isTrailingSurrogate(*lastptr)) 784 792 lastptr--; … … 786 794 prev_is_word = c < 128 && (md.ctypes[c] & ctype_word) != 0; 787 795 } 788 if (stack.currentFrame-> eptr >= md.end_subject)796 if (stack.currentFrame->args.eptr >= md.end_subject) 789 797 cur_is_word = false; 790 798 else { 791 getChar(c, stack.currentFrame-> eptr);799 getChar(c, stack.currentFrame->args.eptr); 792 800 cur_is_word = c < 128 && (md.ctypes[c] & ctype_word) != 0; 793 801 } … … 795 803 /* Now see if the situation is what we want */ 796 804 797 if ((*stack.currentFrame-> ecode++ == OP_WORD_BOUNDARY) ? cur_is_word == prev_is_word : cur_is_word != prev_is_word)805 if ((*stack.currentFrame->args.ecode++ == OP_WORD_BOUNDARY) ? cur_is_word == prev_is_word : cur_is_word != prev_is_word) 798 806 RRETURN_NO_MATCH; 799 807 NEXT_OPCODE; … … 802 810 803 811 BEGIN_OPCODE(ANY): 804 if (stack.currentFrame-> eptr < md.end_subject && isNewline(*stack.currentFrame->eptr))805 RRETURN_NO_MATCH; 806 if (stack.currentFrame-> eptr++ >= md.end_subject)807 RRETURN_NO_MATCH; 808 while (stack.currentFrame-> eptr < md.end_subject && isTrailingSurrogate(*stack.currentFrame->eptr))809 stack.currentFrame-> eptr++;810 stack.currentFrame-> ecode++;812 if (stack.currentFrame->args.eptr < md.end_subject && isNewline(*stack.currentFrame->args.eptr)) 813 RRETURN_NO_MATCH; 814 if (stack.currentFrame->args.eptr++ >= md.end_subject) 815 RRETURN_NO_MATCH; 816 while (stack.currentFrame->args.eptr < md.end_subject && isTrailingSurrogate(*stack.currentFrame->args.eptr)) 817 stack.currentFrame->args.eptr++; 818 stack.currentFrame->args.ecode++; 811 819 NEXT_OPCODE; 812 820 813 821 BEGIN_OPCODE(NOT_DIGIT): 814 if (stack.currentFrame-> eptr >= md.end_subject)815 RRETURN_NO_MATCH; 816 GETCHARINCTEST(c, stack.currentFrame-> eptr);822 if (stack.currentFrame->args.eptr >= md.end_subject) 823 RRETURN_NO_MATCH; 824 GETCHARINCTEST(c, stack.currentFrame->args.eptr); 817 825 if (isASCIIDigit(c)) 818 826 RRETURN_NO_MATCH; 819 stack.currentFrame-> ecode++;827 stack.currentFrame->args.ecode++; 820 828 NEXT_OPCODE; 821 829 822 830 BEGIN_OPCODE(DIGIT): 823 if (stack.currentFrame-> eptr >= md.end_subject)824 RRETURN_NO_MATCH; 825 GETCHARINCTEST(c, stack.currentFrame-> eptr);831 if (stack.currentFrame->args.eptr >= md.end_subject) 832 RRETURN_NO_MATCH; 833 GETCHARINCTEST(c, stack.currentFrame->args.eptr); 826 834 if (!isASCIIDigit(c)) 827 835 RRETURN_NO_MATCH; 828 stack.currentFrame-> ecode++;836 stack.currentFrame->args.ecode++; 829 837 NEXT_OPCODE; 830 838 831 839 BEGIN_OPCODE(NOT_WHITESPACE): 832 if (stack.currentFrame-> eptr >= md.end_subject)833 RRETURN_NO_MATCH; 834 GETCHARINCTEST(c, stack.currentFrame-> eptr);840 if (stack.currentFrame->args.eptr >= md.end_subject) 841 RRETURN_NO_MATCH; 842 GETCHARINCTEST(c, stack.currentFrame->args.eptr); 835 843 if (c < 128 && (md.ctypes[c] & ctype_space)) 836 844 RRETURN_NO_MATCH; 837 stack.currentFrame-> ecode++;845 stack.currentFrame->args.ecode++; 838 846 NEXT_OPCODE; 839 847 840 848 BEGIN_OPCODE(WHITESPACE): 841 if (stack.currentFrame-> eptr >= md.end_subject)842 RRETURN_NO_MATCH; 843 GETCHARINCTEST(c, stack.currentFrame-> eptr);849 if (stack.currentFrame->args.eptr >= md.end_subject) 850 RRETURN_NO_MATCH; 851 GETCHARINCTEST(c, stack.currentFrame->args.eptr); 844 852 if (c >= 128 || !(md.ctypes[c] & ctype_space)) 845 853 RRETURN_NO_MATCH; 846 stack.currentFrame-> ecode++;854 stack.currentFrame->args.ecode++; 847 855 NEXT_OPCODE; 848 856 849 857 BEGIN_OPCODE(NOT_WORDCHAR): 850 if (stack.currentFrame-> eptr >= md.end_subject)851 RRETURN_NO_MATCH; 852 GETCHARINCTEST(c, stack.currentFrame-> eptr);858 if (stack.currentFrame->args.eptr >= md.end_subject) 859 RRETURN_NO_MATCH; 860 GETCHARINCTEST(c, stack.currentFrame->args.eptr); 853 861 if (c < 128 && (md.ctypes[c] & ctype_word)) 854 862 RRETURN_NO_MATCH; 855 stack.currentFrame-> ecode++;863 stack.currentFrame->args.ecode++; 856 864 NEXT_OPCODE; 857 865 858 866 BEGIN_OPCODE(WORDCHAR): 859 if (stack.currentFrame-> eptr >= md.end_subject)860 RRETURN_NO_MATCH; 861 GETCHARINCTEST(c, stack.currentFrame-> eptr);867 if (stack.currentFrame->args.eptr >= md.end_subject) 868 RRETURN_NO_MATCH; 869 GETCHARINCTEST(c, stack.currentFrame->args.eptr); 862 870 if (c >= 128 || !(md.ctypes[c] & ctype_word)) 863 871 RRETURN_NO_MATCH; 864 stack.currentFrame-> ecode++;872 stack.currentFrame->args.ecode++; 865 873 NEXT_OPCODE; 866 874 … … 874 882 875 883 BEGIN_OPCODE(REF): 876 stack.currentFrame->offset = GET2(stack.currentFrame-> ecode, 1) << 1; /* Doubled ref number */877 stack.currentFrame-> ecode += 3; /* Advance past item */884 stack.currentFrame->offset = GET2(stack.currentFrame->args.ecode, 1) << 1; /* Doubled ref number */ 885 stack.currentFrame->args.ecode += 3; /* Advance past item */ 878 886 879 887 /* If the reference is unset, set the length to be longer than the amount … … 882 890 minima. */ 883 891 884 if (stack.currentFrame->offset >= stack.currentFrame-> offset_top || md.offset_vector[stack.currentFrame->offset] < 0)892 if (stack.currentFrame->offset >= stack.currentFrame->args.offset_top || md.offset_vector[stack.currentFrame->offset] < 0) 885 893 stack.currentFrame->length = 0; 886 894 else … … 889 897 /* Set up for repetition, or handle the non-repeated case */ 890 898 891 switch (*stack.currentFrame-> ecode) {899 switch (*stack.currentFrame->args.ecode) { 892 900 case OP_CRSTAR: 893 901 case OP_CRMINSTAR: … … 896 904 case OP_CRQUERY: 897 905 case OP_CRMINQUERY: 898 c = *stack.currentFrame-> ecode++ - OP_CRSTAR;906 c = *stack.currentFrame->args.ecode++ - OP_CRSTAR; 899 907 minimize = (c & 1) != 0; 900 908 min = rep_min[c]; /* Pick up values from tables; */ … … 906 914 case OP_CRRANGE: 907 915 case OP_CRMINRANGE: 908 minimize = (*stack.currentFrame-> ecode == OP_CRMINRANGE);909 min = GET2(stack.currentFrame-> ecode, 1);910 stack.currentFrame->max = GET2(stack.currentFrame-> ecode, 3);916 minimize = (*stack.currentFrame->args.ecode == OP_CRMINRANGE); 917 min = GET2(stack.currentFrame->args.ecode, 1); 918 stack.currentFrame->max = GET2(stack.currentFrame->args.ecode, 3); 911 919 if (stack.currentFrame->max == 0) 912 920 stack.currentFrame->max = INT_MAX; 913 stack.currentFrame-> ecode += 5;921 stack.currentFrame->args.ecode += 5; 914 922 break; 915 923 916 924 default: /* No repeat follows */ 917 if (!match_ref(stack.currentFrame->offset, stack.currentFrame-> eptr, stack.currentFrame->length, md))925 if (!match_ref(stack.currentFrame->offset, stack.currentFrame->args.eptr, stack.currentFrame->length, md)) 918 926 RRETURN_NO_MATCH; 919 stack.currentFrame-> eptr += stack.currentFrame->length;927 stack.currentFrame->args.eptr += stack.currentFrame->length; 920 928 NEXT_OPCODE; 921 929 } … … 930 938 931 939 for (i = 1; i <= min; i++) { 932 if (!match_ref(stack.currentFrame->offset, stack.currentFrame-> eptr, stack.currentFrame->length, md))940 if (!match_ref(stack.currentFrame->offset, stack.currentFrame->args.eptr, stack.currentFrame->length, md)) 933 941 RRETURN_NO_MATCH; 934 stack.currentFrame-> eptr += stack.currentFrame->length;942 stack.currentFrame->args.eptr += stack.currentFrame->length; 935 943 } 936 944 … … 945 953 if (minimize) { 946 954 for (stack.currentFrame->fi = min;; stack.currentFrame->fi++) { 947 RMATCH(20, stack.currentFrame-> ecode, stack.currentFrame->eptrb, 0);955 RMATCH(20, stack.currentFrame->args.ecode, stack.currentFrame->args.eptrb, 0); 948 956 if (is_match) 949 957 RRETURN; 950 if (stack.currentFrame->fi >= stack.currentFrame->max || !match_ref(stack.currentFrame->offset, stack.currentFrame-> eptr, stack.currentFrame->length, md))958 if (stack.currentFrame->fi >= stack.currentFrame->max || !match_ref(stack.currentFrame->offset, stack.currentFrame->args.eptr, stack.currentFrame->length, md)) 951 959 RRETURN; 952 stack.currentFrame-> eptr += stack.currentFrame->length;960 stack.currentFrame->args.eptr += stack.currentFrame->length; 953 961 } 954 962 /* Control never reaches here */ … … 958 966 959 967 else { 960 stack.currentFrame->pp = stack.currentFrame-> eptr;968 stack.currentFrame->pp = stack.currentFrame->args.eptr; 961 969 for (i = min; i < stack.currentFrame->max; i++) { 962 if (!match_ref(stack.currentFrame->offset, stack.currentFrame-> eptr, stack.currentFrame->length, md))963 break; 964 stack.currentFrame-> eptr += stack.currentFrame->length;965 } 966 while (stack.currentFrame-> eptr >= stack.currentFrame->pp) {967 RMATCH(21, stack.currentFrame-> ecode, stack.currentFrame->eptrb, 0);970 if (!match_ref(stack.currentFrame->offset, stack.currentFrame->args.eptr, stack.currentFrame->length, md)) 971 break; 972 stack.currentFrame->args.eptr += stack.currentFrame->length; 973 } 974 while (stack.currentFrame->args.eptr >= stack.currentFrame->pp) { 975 RMATCH(21, stack.currentFrame->args.ecode, stack.currentFrame->args.eptrb, 0); 968 976 if (is_match) 969 977 RRETURN; 970 stack.currentFrame-> eptr -= stack.currentFrame->length;978 stack.currentFrame->args.eptr -= stack.currentFrame->length; 971 979 } 972 980 RRETURN_NO_MATCH; … … 987 995 BEGIN_OPCODE(NCLASS): 988 996 BEGIN_OPCODE(CLASS): 989 stack.currentFrame->data = stack.currentFrame-> ecode + 1; /* Save for matching */990 stack.currentFrame-> ecode += 33; /* Advance past the item */991 992 switch (*stack.currentFrame-> ecode) {997 stack.currentFrame->data = stack.currentFrame->args.ecode + 1; /* Save for matching */ 998 stack.currentFrame->args.ecode += 33; /* Advance past the item */ 999 1000 switch (*stack.currentFrame->args.ecode) { 993 1001 case OP_CRSTAR: 994 1002 case OP_CRMINSTAR: … … 997 1005 case OP_CRQUERY: 998 1006 case OP_CRMINQUERY: 999 c = *stack.currentFrame-> ecode++ - OP_CRSTAR;1007 c = *stack.currentFrame->args.ecode++ - OP_CRSTAR; 1000 1008 minimize = (c & 1) != 0; 1001 1009 min = rep_min[c]; /* Pick up values from tables; */ … … 1007 1015 case OP_CRRANGE: 1008 1016 case OP_CRMINRANGE: 1009 minimize = (*stack.currentFrame-> ecode == OP_CRMINRANGE);1010 min = GET2(stack.currentFrame-> ecode, 1);1011 stack.currentFrame->max = GET2(stack.currentFrame-> ecode, 3);1017 minimize = (*stack.currentFrame->args.ecode == OP_CRMINRANGE); 1018 min = GET2(stack.currentFrame->args.ecode, 1); 1019 stack.currentFrame->max = GET2(stack.currentFrame->args.ecode, 3); 1012 1020 if (stack.currentFrame->max == 0) 1013 1021 stack.currentFrame->max = INT_MAX; 1014 stack.currentFrame-> ecode += 5;1022 stack.currentFrame->args.ecode += 5; 1015 1023 break; 1016 1024 … … 1023 1031 1024 1032 for (i = 1; i <= min; i++) { 1025 if (stack.currentFrame-> eptr >= md.end_subject)1033 if (stack.currentFrame->args.eptr >= md.end_subject) 1026 1034 RRETURN_NO_MATCH; 1027 GETCHARINC(c, stack.currentFrame-> eptr);1035 GETCHARINC(c, stack.currentFrame->args.eptr); 1028 1036 if (c > 255) { 1029 1037 if (stack.currentFrame->data[-1] == OP_CLASS) … … 1044 1052 the pointer while it matches the class. */ 1045 1053 if (minimize) { 1046 { 1047 for (stack.currentFrame->fi = min;; stack.currentFrame->fi++) { 1048 RMATCH(22, stack.currentFrame->ecode, stack.currentFrame->eptrb, 0); 1049 if (is_match) 1054 for (stack.currentFrame->fi = min;; stack.currentFrame->fi++) { 1055 RMATCH(22, stack.currentFrame->args.ecode, stack.currentFrame->args.eptrb, 0); 1056 if (is_match) 1057 RRETURN; 1058 if (stack.currentFrame->fi >= stack.currentFrame->max || stack.currentFrame->args.eptr >= md.end_subject) 1059 RRETURN; 1060 GETCHARINC(c, stack.currentFrame->args.eptr); 1061 if (c > 255) { 1062 if (stack.currentFrame->data[-1] == OP_CLASS) 1050 1063 RRETURN; 1051 if (stack.currentFrame->fi >= stack.currentFrame->max || stack.currentFrame->eptr >= md.end_subject) 1064 } else { 1065 if ((stack.currentFrame->data[c/8] & (1 << (c&7))) == 0) 1052 1066 RRETURN; 1053 GETCHARINC(c, stack.currentFrame->eptr);1054 if (c > 255) {1055 if (stack.currentFrame->data[-1] == OP_CLASS)1056 RRETURN;1057 } else {1058 if ((stack.currentFrame->data[c/8] & (1 << (c&7))) == 0)1059 RRETURN;1060 }1061 1067 } 1062 1068 } … … 1065 1071 /* If maximizing, find the longest possible run, then work backwards. */ 1066 1072 else { 1067 stack.currentFrame->pp = stack.currentFrame-> eptr;1073 stack.currentFrame->pp = stack.currentFrame->args.eptr; 1068 1074 1069 1075 for (i = min; i < stack.currentFrame->max; i++) { 1070 1076 int len = 1; 1071 if (stack.currentFrame-> eptr >= md.end_subject)1072 break; 1073 GETCHARLEN(c, stack.currentFrame-> eptr, len);1077 if (stack.currentFrame->args.eptr >= md.end_subject) 1078 break; 1079 GETCHARLEN(c, stack.currentFrame->args.eptr, len); 1074 1080 if (c > 255) { 1075 1081 if (stack.currentFrame->data[-1] == OP_CLASS) … … 1079 1085 break; 1080 1086 } 1081 stack.currentFrame-> eptr += len;1087 stack.currentFrame->args.eptr += len; 1082 1088 } 1083 1089 for (;;) { 1084 RMATCH(24, stack.currentFrame-> ecode, stack.currentFrame->eptrb, 0);1090 RMATCH(24, stack.currentFrame->args.ecode, stack.currentFrame->args.eptrb, 0); 1085 1091 if (is_match) 1086 1092 RRETURN; 1087 if (stack.currentFrame-> eptr-- == stack.currentFrame->pp)1093 if (stack.currentFrame->args.eptr-- == stack.currentFrame->pp) 1088 1094 break; /* Stop if tried at original pos */ 1089 BACKCHAR(stack.currentFrame-> eptr);1095 BACKCHAR(stack.currentFrame->args.eptr); 1090 1096 } 1091 1097 … … 1098 1104 1099 1105 BEGIN_OPCODE(XCLASS): 1100 stack.currentFrame->data = stack.currentFrame-> ecode + 1 + LINK_SIZE; /* Save for matching */1101 stack.currentFrame-> ecode += GET(stack.currentFrame->ecode, 1); /* Advance past the item */1102 1103 switch (*stack.currentFrame-> ecode) {1106 stack.currentFrame->data = stack.currentFrame->args.ecode + 1 + LINK_SIZE; /* Save for matching */ 1107 stack.currentFrame->args.ecode += GET(stack.currentFrame->args.ecode, 1); /* Advance past the item */ 1108 1109 switch (*stack.currentFrame->args.ecode) { 1104 1110 case OP_CRSTAR: 1105 1111 case OP_CRMINSTAR: … … 1108 1114 case OP_CRQUERY: 1109 1115 case OP_CRMINQUERY: 1110 c = *stack.currentFrame-> ecode++ - OP_CRSTAR;1116 c = *stack.currentFrame->args.ecode++ - OP_CRSTAR; 1111 1117 minimize = (c & 1) != 0; 1112 1118 min = rep_min[c]; /* Pick up values from tables; */ … … 1118 1124 case OP_CRRANGE: 1119 1125 case OP_CRMINRANGE: 1120 minimize = (*stack.currentFrame-> ecode == OP_CRMINRANGE);1121 min = GET2(stack.currentFrame-> ecode, 1);1122 stack.currentFrame->max = GET2(stack.currentFrame-> ecode, 3);1126 minimize = (*stack.currentFrame->args.ecode == OP_CRMINRANGE); 1127 min = GET2(stack.currentFrame->args.ecode, 1); 1128 stack.currentFrame->max = GET2(stack.currentFrame->args.ecode, 3); 1123 1129 if (stack.currentFrame->max == 0) 1124 1130 stack.currentFrame->max = INT_MAX; 1125 stack.currentFrame-> ecode += 5;1131 stack.currentFrame->args.ecode += 5; 1126 1132 break; 1127 1133 … … 1133 1139 1134 1140 for (i = 1; i <= min; i++) { 1135 if (stack.currentFrame-> eptr >= md.end_subject)1141 if (stack.currentFrame->args.eptr >= md.end_subject) 1136 1142 RRETURN_NO_MATCH; 1137 GETCHARINC(c, stack.currentFrame-> eptr);1143 GETCHARINC(c, stack.currentFrame->args.eptr); 1138 1144 if (!_pcre_xclass(c, stack.currentFrame->data)) 1139 1145 RRETURN_NO_MATCH; … … 1151 1157 if (minimize) { 1152 1158 for (stack.currentFrame->fi = min;; stack.currentFrame->fi++) { 1153 RMATCH(26, stack.currentFrame-> ecode, stack.currentFrame->eptrb, 0);1159 RMATCH(26, stack.currentFrame->args.ecode, stack.currentFrame->args.eptrb, 0); 1154 1160 if (is_match) 1155 1161 RRETURN; 1156 if (stack.currentFrame->fi >= stack.currentFrame->max || stack.currentFrame-> eptr >= md.end_subject)1162 if (stack.currentFrame->fi >= stack.currentFrame->max || stack.currentFrame->args.eptr >= md.end_subject) 1157 1163 RRETURN; 1158 GETCHARINC(c, stack.currentFrame-> eptr);1164 GETCHARINC(c, stack.currentFrame->args.eptr); 1159 1165 if (!_pcre_xclass(c, stack.currentFrame->data)) 1160 1166 RRETURN; … … 1166 1172 1167 1173 else { 1168 stack.currentFrame->pp = stack.currentFrame-> eptr;1174 stack.currentFrame->pp = stack.currentFrame->args.eptr; 1169 1175 for (i = min; i < stack.currentFrame->max; i++) { 1170 1176 int len = 1; 1171 if (stack.currentFrame-> eptr >= md.end_subject)1172 break; 1173 GETCHARLEN(c, stack.currentFrame-> eptr, len);1177 if (stack.currentFrame->args.eptr >= md.end_subject) 1178 break; 1179 GETCHARLEN(c, stack.currentFrame->args.eptr, len); 1174 1180 if (!_pcre_xclass(c, stack.currentFrame->data)) 1175 1181 break; 1176 stack.currentFrame-> eptr += len;1182 stack.currentFrame->args.eptr += len; 1177 1183 } 1178 1184 for(;;) { 1179 RMATCH(27, stack.currentFrame-> ecode, stack.currentFrame->eptrb, 0);1185 RMATCH(27, stack.currentFrame->args.ecode, stack.currentFrame->args.eptrb, 0); 1180 1186 if (is_match) 1181 1187 RRETURN; 1182 if (stack.currentFrame-> eptr-- == stack.currentFrame->pp)1188 if (stack.currentFrame->args.eptr-- == stack.currentFrame->pp) 1183 1189 break; /* Stop if tried at original pos */ 1184 BACKCHAR(stack.currentFrame-> eptr)1190 BACKCHAR(stack.currentFrame->args.eptr) 1185 1191 } 1186 1192 RRETURN; … … 1193 1199 BEGIN_OPCODE(CHAR): 1194 1200 stack.currentFrame->length = 1; 1195 stack.currentFrame-> ecode++;1196 getUTF8CharAndIncrementLength(stack.currentFrame->fc, stack.currentFrame-> ecode, stack.currentFrame->length);1201 stack.currentFrame->args.ecode++; 1202 getUTF8CharAndIncrementLength(stack.currentFrame->fc, stack.currentFrame->args.ecode, stack.currentFrame->length); 1197 1203 { 1198 1204 int dc; 1199 stack.currentFrame-> ecode += stack.currentFrame->length;1200 switch (md.end_subject - stack.currentFrame-> eptr) {1205 stack.currentFrame->args.ecode += stack.currentFrame->length; 1206 switch (md.end_subject - stack.currentFrame->args.eptr) { 1201 1207 case 0: 1202 1208 RRETURN_NO_MATCH; 1203 1209 case 1: 1204 dc = *stack.currentFrame-> eptr++;1210 dc = *stack.currentFrame->args.eptr++; 1205 1211 if (isLeadingSurrogate(dc)) 1206 1212 RRETURN_NO_MATCH; 1207 1213 break; 1208 1214 default: 1209 GETCHARINC(dc, stack.currentFrame-> eptr);1215 GETCHARINC(dc, stack.currentFrame->args.eptr); 1210 1216 } 1211 1217 if (stack.currentFrame->fc != dc) … … 1218 1224 BEGIN_OPCODE(CHARNC): 1219 1225 stack.currentFrame->length = 1; 1220 stack.currentFrame-> ecode++;1221 getUTF8CharAndIncrementLength(stack.currentFrame->fc, stack.currentFrame-> ecode, stack.currentFrame->length);1222 1223 if (md.end_subject - stack.currentFrame-> eptr == 0)1226 stack.currentFrame->args.ecode++; 1227 getUTF8CharAndIncrementLength(stack.currentFrame->fc, stack.currentFrame->args.ecode, stack.currentFrame->length); 1228 1229 if (md.end_subject - stack.currentFrame->args.eptr == 0) 1224 1230 RRETURN_NO_MATCH; 1225 1231 1226 1232 { 1227 1233 int dc; 1228 if (md.end_subject - stack.currentFrame-> eptr == 1) {1229 dc = *stack.currentFrame-> eptr++;1234 if (md.end_subject - stack.currentFrame->args.eptr == 1) { 1235 dc = *stack.currentFrame->args.eptr++; 1230 1236 if (isLeadingSurrogate(dc)) 1231 1237 RRETURN_NO_MATCH; 1232 1238 } else 1233 GETCHARINC(dc, stack.currentFrame-> eptr);1234 stack.currentFrame-> ecode += stack.currentFrame->length;1239 GETCHARINC(dc, stack.currentFrame->args.eptr); 1240 stack.currentFrame->args.ecode += stack.currentFrame->length; 1235 1241 1236 1242 /* If we have Unicode property support, we can use it to test the other … … 1247 1253 1248 1254 BEGIN_OPCODE(ASCII_CHAR): 1249 if (md.end_subject == stack.currentFrame-> eptr)1250 RRETURN_NO_MATCH; 1251 if (*stack.currentFrame-> eptr != stack.currentFrame->ecode[1])1252 RRETURN_NO_MATCH; 1253 ++stack.currentFrame-> eptr;1254 stack.currentFrame-> ecode += 2;1255 if (md.end_subject == stack.currentFrame->args.eptr) 1256 RRETURN_NO_MATCH; 1257 if (*stack.currentFrame->args.eptr != stack.currentFrame->args.ecode[1]) 1258 RRETURN_NO_MATCH; 1259 ++stack.currentFrame->args.eptr; 1260 stack.currentFrame->args.ecode += 2; 1255 1261 NEXT_OPCODE; 1256 1262 … … 1258 1264 1259 1265 BEGIN_OPCODE(ASCII_LETTER_NC): 1260 if (md.end_subject == stack.currentFrame-> eptr)1261 RRETURN_NO_MATCH; 1262 if ((*stack.currentFrame-> eptr | 0x20) != stack.currentFrame->ecode[1])1263 RRETURN_NO_MATCH; 1264 ++stack.currentFrame-> eptr;1265 stack.currentFrame-> ecode += 2;1266 if (md.end_subject == stack.currentFrame->args.eptr) 1267 RRETURN_NO_MATCH; 1268 if ((*stack.currentFrame->args.eptr | 0x20) != stack.currentFrame->args.ecode[1]) 1269 RRETURN_NO_MATCH; 1270 ++stack.currentFrame->args.eptr; 1271 stack.currentFrame->args.ecode += 2; 1266 1272 NEXT_OPCODE; 1267 1273 … … 1269 1275 1270 1276 BEGIN_OPCODE(EXACT): 1271 min = stack.currentFrame->max = GET2(stack.currentFrame-> ecode, 1);1277 min = stack.currentFrame->max = GET2(stack.currentFrame->args.ecode, 1); 1272 1278 minimize = false; 1273 stack.currentFrame-> ecode += 3;1279 stack.currentFrame->args.ecode += 3; 1274 1280 goto REPEATCHAR; 1275 1281 … … 1277 1283 BEGIN_OPCODE(MINUPTO): 1278 1284 min = 0; 1279 stack.currentFrame->max = GET2(stack.currentFrame-> ecode, 1);1280 minimize = *stack.currentFrame-> ecode == OP_MINUPTO;1281 stack.currentFrame-> ecode += 3;1285 stack.currentFrame->max = GET2(stack.currentFrame->args.ecode, 1); 1286 minimize = *stack.currentFrame->args.ecode == OP_MINUPTO; 1287 stack.currentFrame->args.ecode += 3; 1282 1288 goto REPEATCHAR; 1283 1289 … … 1288 1294 BEGIN_OPCODE(QUERY): 1289 1295 BEGIN_OPCODE(MINQUERY): 1290 c = *stack.currentFrame-> ecode++ - OP_STAR;1296 c = *stack.currentFrame->args.ecode++ - OP_STAR; 1291 1297 minimize = (c & 1) != 0; 1292 1298 min = rep_min[c]; /* Pick up values from tables; */ … … 1302 1308 1303 1309 stack.currentFrame->length = 1; 1304 getUTF8CharAndIncrementLength(stack.currentFrame->fc, stack.currentFrame-> ecode, stack.currentFrame->length);1305 if (min * (stack.currentFrame->fc > 0xFFFF ? 2 : 1) > md.end_subject - stack.currentFrame-> eptr)1306 RRETURN_NO_MATCH; 1307 stack.currentFrame-> ecode += stack.currentFrame->length;1310 getUTF8CharAndIncrementLength(stack.currentFrame->fc, stack.currentFrame->args.ecode, stack.currentFrame->length); 1311 if (min * (stack.currentFrame->fc > 0xFFFF ? 2 : 1) > md.end_subject - stack.currentFrame->args.eptr) 1312 RRETURN_NO_MATCH; 1313 stack.currentFrame->args.ecode += stack.currentFrame->length; 1308 1314 1309 1315 if (stack.currentFrame->fc <= 0xFFFF) { … … 1311 1317 1312 1318 for (i = 1; i <= min; i++) { 1313 if (*stack.currentFrame-> eptr != stack.currentFrame->fc && *stack.currentFrame->eptr != othercase)1319 if (*stack.currentFrame->args.eptr != stack.currentFrame->fc && *stack.currentFrame->args.eptr != othercase) 1314 1320 RRETURN_NO_MATCH; 1315 ++stack.currentFrame-> eptr;1321 ++stack.currentFrame->args.eptr; 1316 1322 } 1317 1323 … … 1322 1328 stack.currentFrame->repeat_othercase = othercase; 1323 1329 for (stack.currentFrame->fi = min;; stack.currentFrame->fi++) { 1324 RMATCH(28, stack.currentFrame-> ecode, stack.currentFrame->eptrb, 0);1330 RMATCH(28, stack.currentFrame->args.ecode, stack.currentFrame->args.eptrb, 0); 1325 1331 if (is_match) 1326 1332 RRETURN; 1327 if (stack.currentFrame->fi >= stack.currentFrame->max || stack.currentFrame-> eptr >= md.end_subject)1333 if (stack.currentFrame->fi >= stack.currentFrame->max || stack.currentFrame->args.eptr >= md.end_subject) 1328 1334 RRETURN; 1329 if (*stack.currentFrame-> eptr != stack.currentFrame->fc && *stack.currentFrame->eptr != stack.currentFrame->repeat_othercase)1335 if (*stack.currentFrame->args.eptr != stack.currentFrame->fc && *stack.currentFrame->args.eptr != stack.currentFrame->repeat_othercase) 1330 1336 RRETURN; 1331 ++stack.currentFrame-> eptr;1337 ++stack.currentFrame->args.eptr; 1332 1338 } 1333 1339 /* Control never reaches here */ 1334 1340 } else { 1335 stack.currentFrame->pp = stack.currentFrame-> eptr;1341 stack.currentFrame->pp = stack.currentFrame->args.eptr; 1336 1342 for (i = min; i < stack.currentFrame->max; i++) { 1337 if (stack.currentFrame-> eptr >= md.end_subject)1343 if (stack.currentFrame->args.eptr >= md.end_subject) 1338 1344 break; 1339 if (*stack.currentFrame-> eptr != stack.currentFrame->fc && *stack.currentFrame->eptr != othercase)1345 if (*stack.currentFrame->args.eptr != stack.currentFrame->fc && *stack.currentFrame->args.eptr != othercase) 1340 1346 break; 1341 ++stack.currentFrame-> eptr;1347 ++stack.currentFrame->args.eptr; 1342 1348 } 1343 while (stack.currentFrame-> eptr >= stack.currentFrame->pp) {1344 RMATCH(29, stack.currentFrame-> ecode, stack.currentFrame->eptrb, 0);1349 while (stack.currentFrame->args.eptr >= stack.currentFrame->pp) { 1350 RMATCH(29, stack.currentFrame->args.ecode, stack.currentFrame->args.eptrb, 0); 1345 1351 if (is_match) 1346 1352 RRETURN; 1347 --stack.currentFrame-> eptr;1353 --stack.currentFrame->args.eptr; 1348 1354 } 1349 1355 RRETURN_NO_MATCH; … … 1355 1361 for (i = 1; i <= min; i++) { 1356 1362 int nc; 1357 getChar(nc, stack.currentFrame-> eptr);1363 getChar(nc, stack.currentFrame->args.eptr); 1358 1364 if (nc != stack.currentFrame->fc) 1359 1365 RRETURN_NO_MATCH; 1360 stack.currentFrame-> eptr += 2;1366 stack.currentFrame->args.eptr += 2; 1361 1367 } 1362 1368 … … 1367 1373 for (stack.currentFrame->fi = min;; stack.currentFrame->fi++) { 1368 1374 int nc; 1369 RMATCH(30, stack.currentFrame-> ecode, stack.currentFrame->eptrb, 0);1375 RMATCH(30, stack.currentFrame->args.ecode, stack.currentFrame->args.eptrb, 0); 1370 1376 if (is_match) 1371 1377 RRETURN; 1372 if (stack.currentFrame->fi >= stack.currentFrame->max || stack.currentFrame-> eptr >= md.end_subject)1378 if (stack.currentFrame->fi >= stack.currentFrame->max || stack.currentFrame->args.eptr >= md.end_subject) 1373 1379 RRETURN; 1374 getChar(nc, stack.currentFrame-> eptr);1375 if (*stack.currentFrame-> eptr != stack.currentFrame->fc)1380 getChar(nc, stack.currentFrame->args.eptr); 1381 if (*stack.currentFrame->args.eptr != stack.currentFrame->fc) 1376 1382 RRETURN; 1377 stack.currentFrame-> eptr += 2;1383 stack.currentFrame->args.eptr += 2; 1378 1384 } 1379 1385 /* Control never reaches here */ 1380 1386 } else { 1381 stack.currentFrame->pp = stack.currentFrame-> eptr;1387 stack.currentFrame->pp = stack.currentFrame->args.eptr; 1382 1388 for (i = min; i < stack.currentFrame->max; i++) { 1383 1389 int nc; 1384 if (stack.currentFrame-> eptr > md.end_subject - 2)1390 if (stack.currentFrame->args.eptr > md.end_subject - 2) 1385 1391 break; 1386 getChar(nc, stack.currentFrame-> eptr);1387 if (*stack.currentFrame-> eptr != stack.currentFrame->fc)1392 getChar(nc, stack.currentFrame->args.eptr); 1393 if (*stack.currentFrame->args.eptr != stack.currentFrame->fc) 1388 1394 break; 1389 stack.currentFrame-> eptr += 2;1395 stack.currentFrame->args.eptr += 2; 1390 1396 } 1391 while (stack.currentFrame-> eptr >= stack.currentFrame->pp) {1392 RMATCH(31, stack.currentFrame-> ecode, stack.currentFrame->eptrb, 0);1397 while (stack.currentFrame->args.eptr >= stack.currentFrame->pp) { 1398 RMATCH(31, stack.currentFrame->args.ecode, stack.currentFrame->args.eptrb, 0); 1393 1399 if (is_match) 1394 1400 RRETURN; 1395 stack.currentFrame-> eptr -= 2;1401 stack.currentFrame->args.eptr -= 2; 1396 1402 } 1397 1403 RRETURN_NO_MATCH; … … 1405 1411 1406 1412 BEGIN_OPCODE(NOT): 1407 if (stack.currentFrame-> eptr >= md.end_subject)1408 RRETURN_NO_MATCH; 1409 stack.currentFrame-> ecode++;1410 GETCHARINCTEST(c, stack.currentFrame-> eptr);1413 if (stack.currentFrame->args.eptr >= md.end_subject) 1414 RRETURN_NO_MATCH; 1415 stack.currentFrame->args.ecode++; 1416 GETCHARINCTEST(c, stack.currentFrame->args.eptr); 1411 1417 if (md.ignoreCase) { 1412 1418 if (c < 128) 1413 1419 c = md.lowerCaseChars[c]; 1414 if (md.lowerCaseChars[*stack.currentFrame-> ecode++] == c)1420 if (md.lowerCaseChars[*stack.currentFrame->args.ecode++] == c) 1415 1421 RRETURN_NO_MATCH; 1416 1422 } else { 1417 if (*stack.currentFrame-> ecode++ == c)1423 if (*stack.currentFrame->args.ecode++ == c) 1418 1424 RRETURN_NO_MATCH; 1419 1425 } … … 1428 1434 1429 1435 BEGIN_OPCODE(NOTEXACT): 1430 min = stack.currentFrame->max = GET2(stack.currentFrame-> ecode, 1);1436 min = stack.currentFrame->max = GET2(stack.currentFrame->args.ecode, 1); 1431 1437 minimize = false; 1432 stack.currentFrame-> ecode += 3;1438 stack.currentFrame->args.ecode += 3; 1433 1439 goto REPEATNOTCHAR; 1434 1440 … … 1436 1442 BEGIN_OPCODE(NOTMINUPTO): 1437 1443 min = 0; 1438 stack.currentFrame->max = GET2(stack.currentFrame-> ecode, 1);1439 minimize = *stack.currentFrame-> ecode == OP_NOTMINUPTO;1440 stack.currentFrame-> ecode += 3;1444 stack.currentFrame->max = GET2(stack.currentFrame->args.ecode, 1); 1445 minimize = *stack.currentFrame->args.ecode == OP_NOTMINUPTO; 1446 stack.currentFrame->args.ecode += 3; 1441 1447 goto REPEATNOTCHAR; 1442 1448 … … 1447 1453 BEGIN_OPCODE(NOTQUERY): 1448 1454 BEGIN_OPCODE(NOTMINQUERY): 1449 c = *stack.currentFrame-> ecode++ - OP_NOTSTAR;1455 c = *stack.currentFrame->args.ecode++ - OP_NOTSTAR; 1450 1456 minimize = (c & 1) != 0; 1451 1457 min = rep_min[c]; /* Pick up values from tables; */ … … 1458 1464 1459 1465 REPEATNOTCHAR: 1460 if (min > md.end_subject - stack.currentFrame-> eptr)1461 RRETURN_NO_MATCH; 1462 stack.currentFrame->fc = *stack.currentFrame-> ecode++;1466 if (min > md.end_subject - stack.currentFrame->args.eptr) 1467 RRETURN_NO_MATCH; 1468 stack.currentFrame->fc = *stack.currentFrame->args.ecode++; 1463 1469 1464 1470 /* The code is duplicated for the caseless and caseful cases, for speed, … … 1479 1485 int d; 1480 1486 for (i = 1; i <= min; i++) { 1481 GETCHARINC(d, stack.currentFrame-> eptr);1487 GETCHARINC(d, stack.currentFrame->args.eptr); 1482 1488 if (d < 128) 1483 1489 d = md.lowerCaseChars[d]; … … 1493 1499 int d; 1494 1500 for (stack.currentFrame->fi = min;; stack.currentFrame->fi++) { 1495 RMATCH(38, stack.currentFrame-> ecode, stack.currentFrame->eptrb, 0);1501 RMATCH(38, stack.currentFrame->args.ecode, stack.currentFrame->args.eptrb, 0); 1496 1502 if (is_match) 1497 1503 RRETURN; 1498 GETCHARINC(d, stack.currentFrame-> eptr);1504 GETCHARINC(d, stack.currentFrame->args.eptr); 1499 1505 if (d < 128) 1500 1506 d = md.lowerCaseChars[d]; 1501 if (stack.currentFrame->fi >= stack.currentFrame->max || stack.currentFrame-> eptr >= md.end_subject || stack.currentFrame->fc == d)1507 if (stack.currentFrame->fi >= stack.currentFrame->max || stack.currentFrame->args.eptr >= md.end_subject || stack.currentFrame->fc == d) 1502 1508 RRETURN; 1503 1509 } … … 1508 1514 1509 1515 else { 1510 stack.currentFrame->pp = stack.currentFrame-> eptr;1516 stack.currentFrame->pp = stack.currentFrame->args.eptr; 1511 1517 1512 1518 { … … 1514 1520 for (i = min; i < stack.currentFrame->max; i++) { 1515 1521 int len = 1; 1516 if (stack.currentFrame-> eptr >= md.end_subject)1522 if (stack.currentFrame->args.eptr >= md.end_subject) 1517 1523 break; 1518 GETCHARLEN(d, stack.currentFrame-> eptr, len);1524 GETCHARLEN(d, stack.currentFrame->args.eptr, len); 1519 1525 if (d < 128) 1520 1526 d = md.lowerCaseChars[d]; 1521 1527 if (stack.currentFrame->fc == d) 1522 1528 break; 1523 stack.currentFrame-> eptr += len;1529 stack.currentFrame->args.eptr += len; 1524 1530 } 1525 1531 for (;;) { 1526 RMATCH(40, stack.currentFrame-> ecode, stack.currentFrame->eptrb, 0);1532 RMATCH(40, stack.currentFrame->args.ecode, stack.currentFrame->args.eptrb, 0); 1527 1533 if (is_match) 1528 1534 RRETURN; 1529 if (stack.currentFrame-> eptr-- == stack.currentFrame->pp)1535 if (stack.currentFrame->args.eptr-- == stack.currentFrame->pp) 1530 1536 break; /* Stop if tried at original pos */ 1531 BACKCHAR(stack.currentFrame-> eptr);1537 BACKCHAR(stack.currentFrame->args.eptr); 1532 1538 } 1533 1539 } … … 1544 1550 int d; 1545 1551 for (i = 1; i <= min; i++) { 1546 GETCHARINC(d, stack.currentFrame-> eptr);1552 GETCHARINC(d, stack.currentFrame->args.eptr); 1547 1553 if (stack.currentFrame->fc == d) 1548 1554 RRETURN_NO_MATCH; … … 1556 1562 int d; 1557 1563 for (stack.currentFrame->fi = min;; stack.currentFrame->fi++) { 1558 RMATCH(42, stack.currentFrame-> ecode, stack.currentFrame->eptrb, 0);1564 RMATCH(42, stack.currentFrame->args.ecode, stack.currentFrame->args.eptrb, 0); 1559 1565 if (is_match) 1560 1566 RRETURN; 1561 GETCHARINC(d, stack.currentFrame-> eptr);1562 if (stack.currentFrame->fi >= stack.currentFrame->max || stack.currentFrame-> eptr >= md.end_subject || stack.currentFrame->fc == d)1567 GETCHARINC(d, stack.currentFrame->args.eptr); 1568 if (stack.currentFrame->fi >= stack.currentFrame->max || stack.currentFrame->args.eptr >= md.end_subject || stack.currentFrame->fc == d) 1563 1569 RRETURN; 1564 1570 } … … 1569 1575 1570 1576 else { 1571 stack.currentFrame->pp = stack.currentFrame-> eptr;1577 stack.currentFrame->pp = stack.currentFrame->args.eptr; 1572 1578 1573 1579 { … … 1575 1581 for (i = min; i < stack.currentFrame->max; i++) { 1576 1582 int len = 1; 1577 if (stack.currentFrame-> eptr >= md.end_subject)1583 if (stack.currentFrame->args.eptr >= md.end_subject) 1578 1584 break; 1579 GETCHARLEN(d, stack.currentFrame-> eptr, len);1585 GETCHARLEN(d, stack.currentFrame->args.eptr, len); 1580 1586 if (stack.currentFrame->fc == d) 1581 1587 break; 1582 stack.currentFrame-> eptr += len;1588 stack.currentFrame->args.eptr += len; 1583 1589 } 1584 1590 for (;;) { 1585 RMATCH(44, stack.currentFrame-> ecode, stack.currentFrame->eptrb, 0);1591 RMATCH(44, stack.currentFrame->args.ecode, stack.currentFrame->args.eptrb, 0); 1586 1592 if (is_match) 1587 1593 RRETURN; 1588 if (stack.currentFrame-> eptr-- == stack.currentFrame->pp)1594 if (stack.currentFrame->args.eptr-- == stack.currentFrame->pp) 1589 1595 break; /* Stop if tried at original pos */ 1590 BACKCHAR(stack.currentFrame-> eptr);1596 BACKCHAR(stack.currentFrame->args.eptr); 1591 1597 } 1592 1598 } … … 1602 1608 1603 1609 BEGIN_OPCODE(TYPEEXACT): 1604 min = stack.currentFrame->max = GET2(stack.currentFrame-> ecode, 1);1610 min = stack.currentFrame->max = GET2(stack.currentFrame->args.ecode, 1); 1605 1611 minimize = true; 1606 stack.currentFrame-> ecode += 3;1612 stack.currentFrame->args.ecode += 3; 1607 1613 goto REPEATTYPE; 1608 1614 … … 1610 1616 BEGIN_OPCODE(TYPEMINUPTO): 1611 1617 min = 0; 1612 stack.currentFrame->max = GET2(stack.currentFrame-> ecode, 1);1613 minimize = *stack.currentFrame-> ecode == OP_TYPEMINUPTO;1614 stack.currentFrame-> ecode += 3;1618 stack.currentFrame->max = GET2(stack.currentFrame->args.ecode, 1); 1619 minimize = *stack.currentFrame->args.ecode == OP_TYPEMINUPTO; 1620 stack.currentFrame->args.ecode += 3; 1615 1621 goto REPEATTYPE; 1616 1622 … … 1621 1627 BEGIN_OPCODE(TYPEQUERY): 1622 1628 BEGIN_OPCODE(TYPEMINQUERY): 1623 c = *stack.currentFrame-> ecode++ - OP_TYPESTAR;1629 c = *stack.currentFrame->args.ecode++ - OP_TYPESTAR; 1624 1630 minimize = (c & 1) != 0; 1625 1631 min = rep_min[c]; /* Pick up values from tables; */ … … 1633 1639 1634 1640 REPEATTYPE: 1635 stack.currentFrame->ctype = *stack.currentFrame-> ecode++; /* Code for the character type */1641 stack.currentFrame->ctype = *stack.currentFrame->args.ecode++; /* Code for the character type */ 1636 1642 1637 1643 /* First, ensure the minimum number of matches are present. Use inline … … 1643 1649 and single-bytes. */ 1644 1650 1645 if (min > md.end_subject - stack.currentFrame-> eptr)1651 if (min > md.end_subject - stack.currentFrame->args.eptr) 1646 1652 RRETURN_NO_MATCH; 1647 1653 if (min > 0) { … … 1649 1655 case OP_ANY: 1650 1656 for (i = 1; i <= min; i++) { 1651 if (stack.currentFrame-> eptr >= md.end_subject || isNewline(*stack.currentFrame->eptr))1657 if (stack.currentFrame->args.eptr >= md.end_subject || isNewline(*stack.currentFrame->args.eptr)) 1652 1658 RRETURN_NO_MATCH; 1653 ++stack.currentFrame-> eptr;1654 while (stack.currentFrame-> eptr < md.end_subject && isTrailingSurrogate(*stack.currentFrame->eptr))1655 stack.currentFrame-> eptr++;1659 ++stack.currentFrame->args.eptr; 1660 while (stack.currentFrame->args.eptr < md.end_subject && isTrailingSurrogate(*stack.currentFrame->args.eptr)) 1661 stack.currentFrame->args.eptr++; 1656 1662 } 1657 1663 break; … … 1659 1665 case OP_NOT_DIGIT: 1660 1666 for (i = 1; i <= min; i++) { 1661 if (stack.currentFrame-> eptr >= md.end_subject)1667 if (stack.currentFrame->args.eptr >= md.end_subject) 1662 1668 RRETURN_NO_MATCH; 1663 GETCHARINC(c, stack.currentFrame-> eptr);1669 GETCHARINC(c, stack.currentFrame->args.eptr); 1664 1670 if (isASCIIDigit(c)) 1665 1671 RRETURN_NO_MATCH; … … 1669 1675 case OP_DIGIT: 1670 1676 for (i = 1; i <= min; i++) { 1671 if (stack.currentFrame-> eptr >= md.end_subject || !isASCIIDigit(*stack.currentFrame->eptr++))1677 if (stack.currentFrame->args.eptr >= md.end_subject || !isASCIIDigit(*stack.currentFrame->args.eptr++)) 1672 1678 RRETURN_NO_MATCH; 1673 1679 /* No need to skip more bytes - we know it's a 1-byte character */ … … 1677 1683 case OP_NOT_WHITESPACE: 1678 1684 for (i = 1; i <= min; i++) { 1679 if (stack.currentFrame-> eptr >= md.end_subject ||1680 (*stack.currentFrame-> eptr < 128 && (md.ctypes[*stack.currentFrame->eptr] & ctype_space) != 0))1685 if (stack.currentFrame->args.eptr >= md.end_subject || 1686 (*stack.currentFrame->args.eptr < 128 && (md.ctypes[*stack.currentFrame->args.eptr] & ctype_space) != 0)) 1681 1687 RRETURN_NO_MATCH; 1682 while (++stack.currentFrame-> eptr < md.end_subject && isTrailingSurrogate(*stack.currentFrame->eptr)) { }1688 while (++stack.currentFrame->args.eptr < md.end_subject && isTrailingSurrogate(*stack.currentFrame->args.eptr)) { } 1683 1689 } 1684 1690 break; … … 1686 1692 case OP_WHITESPACE: 1687 1693 for (i = 1; i <= min; i++) { 1688 if (stack.currentFrame-> eptr >= md.end_subject ||1689 *stack.currentFrame-> eptr >= 128 || (md.ctypes[*stack.currentFrame->eptr++] & ctype_space) == 0)1694 if (stack.currentFrame->args.eptr >= md.end_subject || 1695 *stack.currentFrame->args.eptr >= 128 || (md.ctypes[*stack.currentFrame->args.eptr++] & ctype_space) == 0) 1690 1696 RRETURN_NO_MATCH; 1691 1697 /* No need to skip more bytes - we know it's a 1-byte character */ … … 1695 1701 case OP_NOT_WORDCHAR: 1696 1702 for (i = 1; i <= min; i++) { 1697 if (stack.currentFrame-> eptr >= md.end_subject ||1698 (*stack.currentFrame-> eptr < 128 && (md.ctypes[*stack.currentFrame->eptr] & ctype_word) != 0))1703 if (stack.currentFrame->args.eptr >= md.end_subject || 1704 (*stack.currentFrame->args.eptr < 128 && (md.ctypes[*stack.currentFrame->args.eptr] & ctype_word) != 0)) 1699 1705 RRETURN_NO_MATCH; 1700 while (++stack.currentFrame-> eptr < md.end_subject && isTrailingSurrogate(*stack.currentFrame->eptr)) { }1706 while (++stack.currentFrame->args.eptr < md.end_subject && isTrailingSurrogate(*stack.currentFrame->args.eptr)) { } 1701 1707 } 1702 1708 break; … … 1704 1710 case OP_WORDCHAR: 1705 1711 for (i = 1; i <= min; i++) { 1706 if (stack.currentFrame-> eptr >= md.end_subject ||1707 *stack.currentFrame-> eptr >= 128 || (md.ctypes[*stack.currentFrame->eptr++] & ctype_word) == 0)1712 if (stack.currentFrame->args.eptr >= md.end_subject || 1713 *stack.currentFrame->args.eptr >= 128 || (md.ctypes[*stack.currentFrame->args.eptr++] & ctype_word) == 0) 1708 1714 RRETURN_NO_MATCH; 1709 1715 /* No need to skip more bytes - we know it's a 1-byte character */ … … 1727 1733 if (minimize) { 1728 1734 for (stack.currentFrame->fi = min;; stack.currentFrame->fi++) { 1729 RMATCH(48, stack.currentFrame-> ecode, stack.currentFrame->eptrb, 0);1735 RMATCH(48, stack.currentFrame->args.ecode, stack.currentFrame->args.eptrb, 0); 1730 1736 if (is_match) 1731 1737 RRETURN; 1732 if (stack.currentFrame->fi >= stack.currentFrame->max || stack.currentFrame-> eptr >= md.end_subject)1738 if (stack.currentFrame->fi >= stack.currentFrame->max || stack.currentFrame->args.eptr >= md.end_subject) 1733 1739 RRETURN; 1734 1740 1735 GETCHARINC(c, stack.currentFrame-> eptr);1741 GETCHARINC(c, stack.currentFrame->args.eptr); 1736 1742 switch(stack.currentFrame->ctype) { 1737 1743 case OP_ANY: … … 1782 1788 1783 1789 else { 1784 stack.currentFrame->pp = stack.currentFrame-> eptr; /* Remember where we started */1790 stack.currentFrame->pp = stack.currentFrame->args.eptr; /* Remember where we started */ 1785 1791 1786 1792 switch(stack.currentFrame->ctype) { … … 1793 1799 if (stack.currentFrame->max < INT_MAX) { 1794 1800 for (i = min; i < stack.currentFrame->max; i++) { 1795 if (stack.currentFrame-> eptr >= md.end_subject || isNewline(*stack.currentFrame->eptr))1801 if (stack.currentFrame->args.eptr >= md.end_subject || isNewline(*stack.currentFrame->args.eptr)) 1796 1802 break; 1797 stack.currentFrame-> eptr++;1798 while (stack.currentFrame-> eptr < md.end_subject && (*stack.currentFrame->eptr & 0xc0) == 0x80)1799 stack.currentFrame-> eptr++;1803 stack.currentFrame->args.eptr++; 1804 while (stack.currentFrame->args.eptr < md.end_subject && (*stack.currentFrame->args.eptr & 0xc0) == 0x80) 1805 stack.currentFrame->args.eptr++; 1800 1806 } 1801 1807 } … … 1805 1811 else { 1806 1812 for (i = min; i < stack.currentFrame->max; i++) { 1807 if (stack.currentFrame-> eptr >= md.end_subject || isNewline(*stack.currentFrame->eptr))1813 if (stack.currentFrame->args.eptr >= md.end_subject || isNewline(*stack.currentFrame->args.eptr)) 1808 1814 break; 1809 stack.currentFrame-> eptr++;1815 stack.currentFrame->args.eptr++; 1810 1816 } 1811 1817 break; … … 1816 1822 for (i = min; i < stack.currentFrame->max; i++) { 1817 1823 int len = 1; 1818 if (stack.currentFrame-> eptr >= md.end_subject)1824 if (stack.currentFrame->args.eptr >= md.end_subject) 1819 1825 break; 1820 GETCHARLEN(c, stack.currentFrame-> eptr, len);1826 GETCHARLEN(c, stack.currentFrame->args.eptr, len); 1821 1827 if (isASCIIDigit(c)) 1822 1828 break; 1823 stack.currentFrame-> eptr+= len;1829 stack.currentFrame->args.eptr+= len; 1824 1830 } 1825 1831 break; … … 1828 1834 for (i = min; i < stack.currentFrame->max; i++) { 1829 1835 int len = 1; 1830 if (stack.currentFrame-> eptr >= md.end_subject)1836 if (stack.currentFrame->args.eptr >= md.end_subject) 1831 1837 break; 1832 GETCHARLEN(c, stack.currentFrame-> eptr, len);1838 GETCHARLEN(c, stack.currentFrame->args.eptr, len); 1833 1839 if (!isASCIIDigit(c)) 1834 1840 break; 1835 stack.currentFrame-> eptr+= len;1841 stack.currentFrame->args.eptr+= len; 1836 1842 } 1837 1843 break; … … 1840 1846 for (i = min; i < stack.currentFrame->max; i++) { 1841 1847 int len = 1; 1842 if (stack.currentFrame-> eptr >= md.end_subject)1848 if (stack.currentFrame->args.eptr >= md.end_subject) 1843 1849 break; 1844 GETCHARLEN(c, stack.currentFrame-> eptr, len);1850 GETCHARLEN(c, stack.currentFrame->args.eptr, len); 1845 1851 if (c < 128 && (md.ctypes[c] & ctype_space)) 1846 1852 break; 1847 stack.currentFrame-> eptr+= len;1853 stack.currentFrame->args.eptr+= len; 1848 1854 } 1849 1855 break; … … 1852 1858 for (i = min; i < stack.currentFrame->max; i++) { 1853 1859 int len = 1; 1854 if (stack.currentFrame-> eptr >= md.end_subject)1860 if (stack.currentFrame->args.eptr >= md.end_subject) 1855 1861 break; 1856 GETCHARLEN(c, stack.currentFrame-> eptr, len);1862 GETCHARLEN(c, stack.currentFrame->args.eptr, len); 1857 1863 if (c >= 128 || !(md.ctypes[c] & ctype_space)) 1858 1864 break; 1859 stack.currentFrame-> eptr+= len;1865 stack.currentFrame->args.eptr+= len; 1860 1866 } 1861 1867 break; … … 1864 1870 for (i = min; i < stack.currentFrame->max; i++) { 1865 1871 int len = 1; 1866 if (stack.currentFrame-> eptr >= md.end_subject)1872 if (stack.currentFrame->args.eptr >= md.end_subject) 1867 1873 break; 1868 GETCHARLEN(c, stack.currentFrame-> eptr, len);1874 GETCHARLEN(c, stack.currentFrame->args.eptr, len); 1869 1875 if (c < 128 && (md.ctypes[c] & ctype_word)) 1870 1876 break; 1871 stack.currentFrame-> eptr+= len;1877 stack.currentFrame->args.eptr+= len; 1872 1878 } 1873 1879 break; … … 1876 1882 for (i = min; i < stack.currentFrame->max; i++) { 1877 1883 int len = 1; 1878 if (stack.currentFrame-> eptr >= md.end_subject)1884 if (stack.currentFrame->args.eptr >= md.end_subject) 1879 1885 break; 1880 GETCHARLEN(c, stack.currentFrame-> eptr, len);1886 GETCHARLEN(c, stack.currentFrame->args.eptr, len); 1881 1887 if (c >= 128 || !(md.ctypes[c] & ctype_word)) 1882 1888 break; 1883 stack.currentFrame-> eptr+= len;1889 stack.currentFrame->args.eptr+= len; 1884 1890 } 1885 1891 break; … … 1890 1896 } 1891 1897 1892 /* stack.currentFrame-> eptr is now past the end of the maximum run */1898 /* stack.currentFrame->args.eptr is now past the end of the maximum run */ 1893 1899 1894 1900 for (;;) { 1895 RMATCH(52, stack.currentFrame-> ecode, stack.currentFrame->eptrb, 0);1901 RMATCH(52, stack.currentFrame->args.ecode, stack.currentFrame->args.eptrb, 0); 1896 1902 if (is_match) 1897 1903 RRETURN; 1898 if (stack.currentFrame-> eptr-- == stack.currentFrame->pp)1904 if (stack.currentFrame->args.eptr-- == stack.currentFrame->pp) 1899 1905 break; /* Stop if tried at original pos */ 1900 BACKCHAR(stack.currentFrame-> eptr);1906 BACKCHAR(stack.currentFrame->args.eptr); 1901 1907 } 1902 1908 … … 1937 1943 here; that is handled in the code for KET. */ 1938 1944 1939 ASSERT(*stack.currentFrame-> ecode > OP_BRA);1940 1941 stack.currentFrame->number = *stack.currentFrame-> ecode - OP_BRA;1945 ASSERT(*stack.currentFrame->args.ecode > OP_BRA); 1946 1947 stack.currentFrame->number = *stack.currentFrame->args.ecode - OP_BRA; 1942 1948 1943 1949 /* For extended extraction brackets (large number), we have to fish out the … … 1945 1951 1946 1952 if (stack.currentFrame->number > EXTRACT_BASIC_MAX) 1947 stack.currentFrame->number = GET2(stack.currentFrame-> ecode, 2+LINK_SIZE);1953 stack.currentFrame->number = GET2(stack.currentFrame->args.ecode, 2+LINK_SIZE); 1948 1954 stack.currentFrame->offset = stack.currentFrame->number << 1; 1949 1955 1950 1956 #ifdef DEBUG 1951 1957 printf("start bracket %d subject=", stack.currentFrame->number); 1952 pchars(stack.currentFrame-> eptr, 16, true, md);1958 pchars(stack.currentFrame->args.eptr, 16, true, md); 1953 1959 printf("\n"); 1954 1960 #endif … … 1960 1966 1961 1967 DPRINTF(("saving %d %d %d\n", stack.currentFrame->save_offset1, stack.currentFrame->save_offset2, stack.currentFrame->save_offset3)); 1962 md.offset_vector[md.offset_end - stack.currentFrame->number] = stack.currentFrame-> eptr - md.start_subject;1968 md.offset_vector[md.offset_end - stack.currentFrame->number] = stack.currentFrame->args.eptr - md.start_subject; 1963 1969 1964 1970 do { 1965 RMATCH(1, stack.currentFrame-> ecode + 1 + LINK_SIZE, stack.currentFrame->eptrb, match_isgroup);1971 RMATCH(1, stack.currentFrame->args.ecode + 1 + LINK_SIZE, stack.currentFrame->args.eptrb, match_isgroup); 1966 1972 if (is_match) RRETURN; 1967 stack.currentFrame-> ecode += GET(stack.currentFrame->ecode, 1);1968 } while (*stack.currentFrame-> ecode == OP_ALT);1973 stack.currentFrame->args.ecode += GET(stack.currentFrame->args.ecode, 1); 1974 } while (*stack.currentFrame->args.ecode == OP_ALT); 1969 1975 1970 1976 DPRINTF(("bracket %d failed\n", stack.currentFrame->number));
Note:
See TracChangeset
for help on using the changeset viewer.