From 80f50674781b2e8cbc40287142fb1d06f27e4d76 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 24 Apr 2017 06:17:55 +0000 Subject: 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 --- test/ruby/test_parse.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/ruby') 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")}} -- cgit v1.2.3