Ticket #4191: patch_basic_regex_creator.patch
File patch_basic_regex_creator.patch, 2.1 KB (added by , 12 years ago) |
---|
-
.hpp
old new 769 769 case syntax_element_assert_backref: 770 770 { 771 771 // just check that the index is valid: 772 int id = static_cast<const re_brace*>(state)->index;773 if(id < 0)772 int idstate = static_cast<const re_brace*>(state)->index; 773 if(idstate < 0) 774 774 { 775 id = -id-1;776 if(id >= 10000)775 idstate = -idstate-1; 776 if(idstate >= 10000) 777 777 { 778 id = m_pdata->get_id(id);779 if(id <= 0)778 idstate = m_pdata->get_id(idstate); 779 if(idstate <= 0) 780 780 { 781 781 // check of sub-expression that doesn't exist: 782 782 if(0 == this->m_pdata->m_status) // update the error code if not already set … … 804 804 { 805 805 bool ok = false; 806 806 re_syntax_base* p = base; 807 int id = static_cast<re_jump*>(state)->alt.i;808 if(id > 10000)809 id = m_pdata->get_id(id);807 int idstate = static_cast<re_jump*>(state)->alt.i; 808 if(idstate > 10000) 809 idstate = m_pdata->get_id(idstate); 810 810 while(p) 811 811 { 812 if((p->type == syntax_element_startmark) && (static_cast<re_brace*>(p)->index == id ))812 if((p->type == syntax_element_startmark) && (static_cast<re_brace*>(p)->index == idstate)) 813 813 { 814 814 // 815 815 // We've found the target of the recursion, set the jump target: … … 833 833 next_rep_id = static_cast<re_repeat*>(p)->state_id; 834 834 break; 835 835 case syntax_element_endmark: 836 if(static_cast<const re_brace*>(p)->index == id )836 if(static_cast<const re_brace*>(p)->index == idstate) 837 837 next_rep_id = -1; 838 838 break; 839 839 default: