diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-06-28 02:02:38 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-06-28 02:02:38 +0000 |
commit | 76a3d5633582c269c9c3a0b0d259b5f7b24df5c9 (patch) | |
tree | 193a7f9efe476201b6f5b413a0407e1f3476fa25 /test | |
parent | b120d0fcddd219e4d23a2027a4b3599d772158b8 (diff) | |
download | ruby-76a3d5633582c269c9c3a0b0d259b5f7b24df5c9.tar.gz |
parse.y: fix parser_yyerror
* parse.y (parser_yyerror): fix buffer overflow at truncation of
error line. [ruby-core:81790] [Bug #13687]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59188 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_parse.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_parse.rb b/test/ruby/test_parse.rb index 030442f9e9..d2fc5f0721 100644 --- a/test/ruby/test_parse.rb +++ b/test/ruby/test_parse.rb @@ -1001,6 +1001,12 @@ x = __ENCODING__ end; end + def test_unexpected_token_error + assert_raise(SyntaxError) do + eval('"x"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx') + end + end + =begin def test_past_scope_variable assert_warning(/past scope/) {catch {|tag| eval("BEGIN{throw tag}; tap {a = 1}; a")}} |