8000 merge revision(s) 597955a,8b65d15: [Backport #20173] by nurse · Pull Request #9794 · ruby/ruby · GitHub
[go: up one dir, main page]

Skip to content

merge revision(s) 597955a,8b65d15: [Backport #20173] #9794

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

Merged
merged 1 commit into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 2 additions & 1 deletion regexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -3756,14 +3756,15 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,

CASE(OP_PUSH_IF_PEEK_NEXT) MOP_IN(OP_PUSH_IF_PEEK_NEXT);
GET_RELADDR_INC(addr, p);
CHECK_MATCH_CACHE;
if (*p == *s) {
p++;
CHECK_MATCH_CACHE;
STACK_PUSH_ALT(p + addr, s, sprev, pkeep);
MOP_OUT;
JUMP;
}
p++;
INC_NUM_FAILS;
MOP_OUT;
JUMP;

Expand Down
9 changes: 9 additions & 0 deletions test/ruby/test_regexp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1945,6 +1945,15 @@ def test_match_cache_negative_look_behind
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}$'
Expand Down
2 changes: 1 addition & 1 deletion version.h
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 6
#define RUBY_PATCHLEVEL 7

#include "ruby/version.h"
#include "ruby/internal/abi.h"
Expand Down
0