diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-10-23 13:02:52 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-10-23 13:02:52 +0000 |
commit | ac83fcdc8ea49cdf30174b452793510d16179642 (patch) | |
tree | 0af7fe24cd63676ca70b07b2e75d75b91f9defc9 | |
parent | 1cdb944024d0a30bc3730186448ab5bb5862b8e4 (diff) |
merges r29410 from trunk into ruby_1_9_2.
--
* parse.y (regexp): dregexp has literal string only at the head
and successors are array. [ruby-core:32682]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@29572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | parse.y | 3 | ||||
-rw-r--r-- | test/ruby/test_literal.rb | 2 | ||||
-rw-r--r-- | version.h | 2 |
4 files changed, 10 insertions, 2 deletions
@@ -1,3 +1,8 @@ +Mon Oct 4 12:43:47 2010 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * parse.y (regexp): dregexp has literal string only at the head + and successors are array. [ruby-core:32682] + Tue Aug 10 11:26:33 2010 NAKAMURA Usaku <usa@ruby-lang.org> * lib/un.rb (httpd): SIGQUIT and SIGHUP are not guaranteed to exist. @@ -3890,7 +3890,8 @@ regexp : tREGEXP_BEG regexp_contents tREGEXP_END if (nd_type(list->nd_head) == NODE_STR) { VALUE tail = list->nd_head->nd_lit; if (reg_fragment_check(tail, options) && prev && !NIL_P(prev->nd_lit)) { - if (!literal_concat0(parser, prev->nd_lit, tail)) { + VALUE lit = prev == node ? prev->nd_lit : prev->nd_head->nd_lit; + if (!literal_concat0(parser, lit, tail)) { node = 0; break; } diff --git a/test/ruby/test_literal.rb b/test/ruby/test_literal.rb index b4480f725a..2c7065c422 100644 --- a/test/ruby/test_literal.rb +++ b/test/ruby/test_literal.rb @@ -107,6 +107,8 @@ class TestRubyLiteral < Test::Unit::TestCase def test_dregexp assert_instance_of Regexp, /re#{'ge'}xp/ assert_equal(/regexp/, /re#{'ge'}xp/) + bug3903 = '[ruby-core:32682]' + assert_raise(SyntaxError, bug3903) {eval('/[#{"\x80"}]/')} end def test_array @@ -1,5 +1,5 @@ #define RUBY_VERSION "1.9.2" -#define RUBY_PATCHLEVEL 25 +#define RUBY_PATCHLEVEL 26 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 9 #define RUBY_VERSION_TEENY 1 |