merge revision(s) b726d60c98: [Backport #19273]

Fix [Bug 19273], set correct value to `outer_repeat` on `OP_REPEAT`
	 (#7035)

	---
	 regexec.c                | 2 +-
	 test/ruby/test_regexp.rb | 5 +++++
	 2 files changed, 6 insertions(+), 1 deletion(-)
This commit is contained in:
NARUSE, Yui 2022-12-29 15:59:52 +09:00
parent 5c551ac59f
commit a7d467a792
3 changed files with 7 additions and 2 deletions

View file

@ -1721,6 +1721,11 @@ class TestRegexp < Test::Unit::TestCase
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")
end
def test_linear_time_p
assert_send [Regexp, :linear_time?, /a/]
assert_send [Regexp, :linear_time?, 'a']