diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-04-24 06:17:55 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-04-24 06:17:55 +0000 |
commit | 80f50674781b2e8cbc40287142fb1d06f27e4d76 (patch) | |
tree | 42d30e2e7babdd137c5f0176c09ac3c20422cbd8 /test | |
parent | 7c23609e6057a5cbe8e9c7b39ba565bd75dd2a09 (diff) | |
download | ruby-80f50674781b2e8cbc40287142fb1d06f27e4d76.tar.gz |
parse.y: args tail at error
* parse.y (new_args_tail_gen): abandon parsing arguments after
error. reported by ilsani Martino Sani (ilsani) at
https://hackerone.com/reports/221201
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_parse.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_parse.rb b/test/ruby/test_parse.rb index b4a63e369d..c2ee56ae52 100644 --- a/test/ruby/test_parse.rb +++ b/test/ruby/test_parse.rb @@ -958,6 +958,13 @@ x = __ENCODING__ assert_syntax_error(" 0b\n", /\^/) end + def test_error_def_in_argument + assert_separately([], "#{<<-"begin;"}\n#{<<~"end;"}") + begin; + assert_syntax_error("def f r:def d; def f 0end", /unexpected/) + end; + end + =begin def test_past_scope_variable assert_warning(/past scope/) {catch {|tag| eval("BEGIN{throw tag}; tap {a = 1}; a")}} |