зеркало из https://github.com/github/ruby.git
[Bug #19587] Fix `reset_match_cache` arguments
This commit is contained in:
Родитель
1b697d7cb5
Коммит
0ac3f2c20e
|
@ -3480,7 +3480,7 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
|
|||
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_opcode, msa->num_cache_table);
|
||||
}
|
||||
# endif
|
||||
}
|
||||
|
|
|
@ -1750,6 +1750,14 @@ class TestRegexp < Test::Unit::TestCase
|
|||
end;
|
||||
end
|
||||
|
||||
def test_cache_index_initialize
|
||||
str = 'test1-test2-test3-test4-test_5'
|
||||
re = '^([0-9a-zA-Z\-/]*){1,256}$'
|
||||
100.times do
|
||||
assert !Regexp.new(re).match?(str)
|
||||
end
|
||||
end
|
||||
|
||||
def test_bug_19273 # [Bug #19273]
|
||||
pattern = /(?:(?:-?b)|(?:-?(?:1_?(?:0_?)*)?0))(?::(?:(?:-?b)|(?:-?(?:1_?(?:0_?)*)?0))){0,3}/
|
||||
assert_equal("10:0:0".match(pattern)[0], "10:0:0")
|
||||
|
|
Загрузка…
Ссылка в новой задаче