From 7231fc5baa0a44ef6264c795071c5fbec8d1102d Mon Sep 17 00:00:00 2001 From: "NARUSE, Yui" Date: Thu, 1 Feb 2024 16:13:50 +0900 Subject: merge revision(s) 597955a,8b65d15: [Backport #20173] (#9794) Fix to work match cache with peek next optimization (#9459) --- regexec.c | 3 ++- test/ruby/test_regexp.rb | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) Fix test case for `test_match_cache_with_peek_optimization` (#9466) --- test/ruby/test_regexp.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- test/ruby/test_regexp.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_regexp.rb b/test/ruby/test_regexp.rb index 43357b0c64..91a9f0a96c 100644 --- a/test/ruby/test_regexp.rb +++ b/test/ruby/test_regexp.rb @@ -1945,6 +1945,15 @@ class TestRegexp < Test::Unit::TestCase end; end + def test_match_cache_with_peek_optimization + assert_separately([], "#{<<-"begin;"}\n#{<<-'end;'}") + timeout = #{ EnvUtil.apply_timeout_scale(10).inspect } + begin; + Regexp.timeout = timeout + assert_nil(/a+z/ =~ "a" * 1000000 + "xz") + end; + end + def test_cache_opcodes_initialize str = 'test1-test2-test3-test4-test_5' re = '^([0-9a-zA-Z\-/]*){1,256}$' -- cgit v1.2.3