10000 backport 20172 by nurse · Pull Request #9796 · ruby/ruby · GitHub
[go: up one dir, main page]

Skip to content

backport 20172 #9796

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 14 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
merge revision(s) d8702dd: [Backport #20083]
	Fix [Bug #20083]: correct a cache point size for atomic groups
	 (#9367)

	---
	 regexec.c                | 2 +-
	 test/ruby/test_regexp.rb | 8 ++++++++
	 2 files changed, 9 insertions(+), 1 deletion(-)
  • Loading branch information
nurse committed Jan 30, 2024
commit 5f3dfa1c273c6fb9eae65ceca633b46f7e30f686
2 changes: 1 addition & 1 deletion regexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ init_cache_opcodes(const regex_t* reg, OnigCacheOpcode* cache_opcodes, long* num
cache_opcodes->num_cache_points_at_outer_repeat = num_cache_points_at_repeat;\
cache_opcodes->num_cache_points_in_outer_repeat = 0;\
cache_opcodes->lookaround_nesting = lookaround_nesting;\
cache_point += lookaround_nesting > 0 ? 2 : 1;\
cache_point += lookaround_nesting != 0 ? 2 : 1;\
cache_opcodes++;\
} while (0)

Expand Down
8 changes: 8 additions & 0 deletions test/ruby/test_regexp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1979,6 +1979,14 @@ def test_bug_19537 # [Bug #19537]
end
end

def test_bug_20083 # [Bug #20083]
re = /([\s]*ABC)$/i
(1..100).each do |n|
text = "#{"0" * n}ABC"
assert text.match?(re)
end
end

def test_linear_time_p
assert_send [Regexp, :linear_time?, /a/]
assert_send [Regexp, :linear_time?, 'a']
Expand Down
2 changes: 1 addition & 1 deletion version.h
4ED3
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# define RUBY_VERSION_MINOR RUBY_API_VERSION_MINOR
#define RUBY_VERSION_TEENY 0
#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/internal/abi.h"
Expand Down
0