summaryrefslogtreecommitdiff
path: root/test/ruby/test_parse.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-07-25 08:30:11 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-07-25 08:30:11 +0000
commitf29e5013adcd9c8753587471727e3280aaf89686 (patch)
treed3b5665545097cce8450dac62a61e41b77eb28ca /test/ruby/test_parse.rb
parent8e2d0deb88c4c9539b5c963da8cfad2e8205298e (diff)
parse.y: limit codepoint length
* parse.y (parser_tokadd_codepoint): limit Unicode codepoint length. too long codepoint has been split unexpectedly since r57050. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_parse.rb')
-rw-r--r--test/ruby/test_parse.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/ruby/test_parse.rb b/test/ruby/test_parse.rb
index 982f91dc52..cc38214fd6 100644
--- a/test/ruby/test_parse.rb
+++ b/test/ruby/test_parse.rb
@@ -516,6 +516,8 @@ class TestParse < Test::Unit::TestCase
src = '"\xD0\u{90'"\n""000000000000000000000000"
assert_syntax_error(src, /:#{__LINE__}: unterminated/o)
+ assert_syntax_error('"\u{100000000}"', /invalid Unicode escape/)
+
assert_equal("\x81", eval('"\C-\M-a"'))
assert_equal("\177", eval('"\c?"'))
end