Project

General

Profile

Bug #19537 » ruby-19537.patch

jj1uzh (Futa Miyachi), 03/18/2023 02:33 PM

View differences:

regexec.c
}
static void
reset_match_cache(regex_t* reg, UChar* pbegin, UChar* pend, long pos, uint8_t* match_cache, OnigCacheIndex *table, long num_cache_size, long num_cache_table)
reset_match_cache(regex_t* reg, UChar* pbegin, UChar* pend, long pos, uint8_t* match_cache, OnigCacheIndex *table, long num_cache_size)
{
long l = 0, r = num_cache_table - 1, m1 = 0, m2 = 0;
long l = 0, r = num_cache_size - 1, m1 = 0, m2 = 0;
int is_inc = *pend == OP_REPEAT_INC || *pend == OP_REPEAT_INC_NG;
OnigCacheIndex *item1, *item2;
long k1, k2, base;
......
else r = m1 - 1;
}
l = 0, r = num_cache_table - 1;
l = 0, r = num_cache_size - 1;
while (l <= r) {
m2 = (l + r) / 2;
if (table[m2].addr == pend) break;
......
else r = m2 - 1;
}
if (table[m1].addr < pbegin && m1 + 1 < num_cache_table) m1++;
if (table[m1].addr < pbegin && m1 + 1 < num_cache_size) m1++;
if (table[m2].addr > pend && m2 - 1 > 0) m2--;
item1 = &table[m1];
......
default:
goto unexpected_bytecode_error;
}
reset_match_cache(reg, addr, pbegin, (long)(s - str), msa->match_cache, msa->cache_index_table, msa->num_cache_table ,msa->num_cache_opcode);
reset_match_cache(reg, addr, pbegin, (long)(s - str), msa->match_cache, msa->cache_index_table, msa->num_cache_table);
}
# endif
}
(2-2/2)