mirror of
https://github.com/ruby/ruby.git
synced 2025-08-16 05:59:00 +02:00
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:
parent
5c551ac59f
commit
a7d467a792
3 changed files with 7 additions and 2 deletions
|
@ -615,7 +615,7 @@ init_cache_index_table(regex_t* reg, OnigCacheIndex *table)
|
||||||
if (reg->repeat_range[mem].lower == 0) {
|
if (reg->repeat_range[mem].lower == 0) {
|
||||||
table->addr = pbegin;
|
table->addr = pbegin;
|
||||||
table->num = num - current_mem_num;
|
table->num = num - current_mem_num;
|
||||||
table->outer_repeat = mem;
|
table->outer_repeat = -1;
|
||||||
num++;
|
num++;
|
||||||
table++;
|
table++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1721,6 +1721,11 @@ class TestRegexp < Test::Unit::TestCase
|
||||||
end;
|
end;
|
||||||
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
|
def test_linear_time_p
|
||||||
assert_send [Regexp, :linear_time?, /a/]
|
assert_send [Regexp, :linear_time?, /a/]
|
||||||
assert_send [Regexp, :linear_time?, 'a']
|
assert_send [Regexp, :linear_time?, 'a']
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
# define RUBY_VERSION_MINOR RUBY_API_VERSION_MINOR
|
# define RUBY_VERSION_MINOR RUBY_API_VERSION_MINOR
|
||||||
#define RUBY_VERSION_TEENY 0
|
#define RUBY_VERSION_TEENY 0
|
||||||
#define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR
|
#define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR
|
||||||
#define RUBY_PATCHLEVEL 1
|
#define RUBY_PATCHLEVEL 2
|
||||||
|
|
||||||
#include "ruby/version.h"
|
#include "ruby/version.h"
|
||||||
#include "ruby/internal/abi.h"
|
#include "ruby/internal/abi.h"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue