forked from boostorg/regex
Change "id" to "idx" to be Objective C++ compatible.
Fixes #2306. Fixes #4132. Fixes #4191. [SVN r61789]
This commit is contained in:
@ -769,14 +769,14 @@ void basic_regex_creator<charT, traits>::fixup_recursions(re_syntax_base* state)
|
||||
case syntax_element_assert_backref:
|
||||
{
|
||||
// just check that the index is valid:
|
||||
int id = static_cast<const re_brace*>(state)->index;
|
||||
if(id < 0)
|
||||
int idx = static_cast<const re_brace*>(state)->index;
|
||||
if(idx < 0)
|
||||
{
|
||||
id = -id-1;
|
||||
if(id >= 10000)
|
||||
idx = -idx-1;
|
||||
if(idx >= 10000)
|
||||
{
|
||||
id = m_pdata->get_id(id);
|
||||
if(id <= 0)
|
||||
idx = m_pdata->get_id(idx);
|
||||
if(idx <= 0)
|
||||
{
|
||||
// check of sub-expression that doesn't exist:
|
||||
if(0 == this->m_pdata->m_status) // update the error code if not already set
|
||||
@ -804,12 +804,12 @@ void basic_regex_creator<charT, traits>::fixup_recursions(re_syntax_base* state)
|
||||
{
|
||||
bool ok = false;
|
||||
re_syntax_base* p = base;
|
||||
std::ptrdiff_t id = static_cast<re_jump*>(state)->alt.i;
|
||||
if(id > 10000)
|
||||
id = m_pdata->get_id(id);
|
||||
std::ptrdiff_t idx = static_cast<re_jump*>(state)->alt.i;
|
||||
if(idx > 10000)
|
||||
idx = m_pdata->get_id(idx);
|
||||
while(p)
|
||||
{
|
||||
if((p->type == syntax_element_startmark) && (static_cast<re_brace*>(p)->index == id))
|
||||
if((p->type == syntax_element_startmark) && (static_cast<re_brace*>(p)->index == idx))
|
||||
{
|
||||
//
|
||||
// We've found the target of the recursion, set the jump target:
|
||||
@ -833,7 +833,7 @@ void basic_regex_creator<charT, traits>::fixup_recursions(re_syntax_base* state)
|
||||
next_rep_id = static_cast<re_repeat*>(p)->state_id;
|
||||
break;
|
||||
case syntax_element_endmark:
|
||||
if(static_cast<const re_brace*>(p)->index == id)
|
||||
if(static_cast<const re_brace*>(p)->index == idx)
|
||||
next_rep_id = -1;
|
||||
break;
|
||||
default:
|
||||
@ -1543,3 +1543,4 @@ void basic_regex_creator<charT, traits>::probe_leading_repeat(re_syntax_base* st
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user