summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-10-23 13:02:52 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-10-23 13:02:52 +0000
commitac83fcdc8ea49cdf30174b452793510d16179642 (patch)
tree0af7fe24cd63676ca70b07b2e75d75b91f9defc9
parent1cdb944024d0a30bc3730186448ab5bb5862b8e4 (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--ChangeLog5
-rw-r--r--parse.y3
-rw-r--r--test/ruby/test_literal.rb2
-rw-r--r--version.h2
4 files changed, 10 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index c0dc004d6a..525122225d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
diff --git a/parse.y b/parse.y
index 15fb4912ef..ff683a38b4 100644
--- a/parse.y
+++ b/parse.y
@@ -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
diff --git a/version.h b/version.h
index 17834f5a38..c476ecedc3 100644
--- a/version.h
+++ b/version.h
@@ -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