1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

merge revision(s) 55154: [Backport #12418]

* regcomp.c (compile_length_tree): return error code immediately
	  if compile_length_tree raised error [Bug #12418]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@55384 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nagachika 2016-06-11 17:47:43 +00:00
parent e206da0ab8
commit 2aa3817e52
4 changed files with 16 additions and 6 deletions

View file

@ -1,3 +1,8 @@
Sun Jun 12 02:36:52 2016 NARUSE, Yui <naruse@ruby-lang.org>
* regcomp.c (compile_length_tree): return error code immediately
if compile_length_tree raised error [Bug #12418]
Sun Jun 12 02:27:07 2016 NAKAMURA Usaku <usa@ruby-lang.org>
* thread.c (recursive_list_access): a object id may be a Bignum. so,

View file

@ -1592,13 +1592,15 @@ compile_length_tree(Node* node, regex_t* reg)
case NT_ALT:
{
int n;
n = r = 0;
int n = 0;
len = 0;
do {
r += compile_length_tree(NCAR(node), reg);
n++;
r = compile_length_tree(NCAR(node), reg);
if (r < 0) return r;
len += r;
n++;
} while (IS_NOT_NULL(node = NCDR(node)));
r = len;
r += (SIZE_OP_PUSH + SIZE_OP_JUMP) * (n - 1);
}
break;

View file

@ -1003,6 +1003,9 @@ class TestRegexp < Test::Unit::TestCase
conds = {"xy"=>true, "yx"=>true, "xx"=>false, "yy"=>false}
assert_match_each(/\A((x)|(y))(?(2)y|x)\z/, conds, bug8583)
assert_match_each(/\A((?<x>x)|(?<y>y))(?(<x>)y|x)\z/, conds, bug8583)
bug12418 = '[ruby-core:75694] [Bug #12418]'
assert_raise(RegexpError, bug12418){ Regexp.new('(0?0|(?(5)||)|(?(5)||))?') }
end
def test_options_in_look_behind

View file

@ -1,6 +1,6 @@
#define RUBY_VERSION "2.3.2"
#define RUBY_RELEASE_DATE "2016-06-12"
#define RUBY_PATCHLEVEL 122
#define RUBY_PATCHLEVEL 123
#define RUBY_RELEASE_YEAR 2016
#define RUBY_RELEASE_MONTH 6