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
This commit is contained in:
nobu 2017-07-25 08:30:11 +00:00
parent 8e2d0deb88
commit f29e5013ad
2 changed files with 10 additions and 9 deletions

View file

@ -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