diff options
| -rw-r--r-- | regexec.c | 2 | ||||
| -rw-r--r-- | test/ruby/test_regexp.rb | 8 | ||||
| -rw-r--r-- | version.h | 2 |
3 files changed, 10 insertions, 2 deletions
@@ -3483,7 +3483,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 } diff --git a/test/ruby/test_regexp.rb b/test/ruby/test_regexp.rb index 80b652773d..b515ff8b14 100644 --- a/test/ruby/test_regexp.rb +++ b/test/ruby/test_regexp.rb @@ -1782,6 +1782,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") @@ -11,7 +11,7 @@ # define RUBY_VERSION_MINOR RUBY_API_VERSION_MINOR #define RUBY_VERSION_TEENY 2 #define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR -#define RUBY_PATCHLEVEL 85 +#define RUBY_PATCHLEVEL 86 #include "ruby/version.h" #include "ruby/internal/abi.h" |
