diff options
author | Nobuyoshi Nakada <[email protected]> | 2023-07-19 01:27:45 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2023-07-19 03:40:05 +0900 |
commit | fe4d906f5fbacbe6e9267af3bd3503339bad63a9 (patch) | |
tree | 504787b149ac6212203202572189b8aa93266486 /test/ruby/test_syntax.rb | |
parent | ac7d34026aced2d38045fae05676d9c1605aa08d (diff) |
[Bug #19774] Fix segfault at `return` in `END`
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/8093
Diffstat (limited to 'test/ruby/test_syntax.rb')
-rw-r--r-- | test/ruby/test_syntax.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb index 5c382fac7a..670bb27892 100644 --- a/test/ruby/test_syntax.rb +++ b/test/ruby/test_syntax.rb @@ -1370,6 +1370,7 @@ eom nil&defined?0--begin e=no_method_error(); return; 0;end return puts('ignored') #=> ignored BEGIN {return} + END {return if false} end; .split(/\n/).map {|s|[(line+=1), *s.split(/#=> /, 2)]} failed = proc do |n, s| @@ -1407,6 +1408,10 @@ eom assert_in_out_err(['-e', 'class TestSyntax; proc{ return }.call; end'], "", [], /^-e:1:.*unexpected return \(LocalJumpError\)/) end + def test_return_in_END + assert_normal_exit('END {return}') + end + def test_syntax_error_in_rescue bug12613 = '[ruby-core:76531] [Bug #12613]' assert_syntax_error("#{<<-"begin;"}\n#{<<-"end;"}", /Invalid retry/, bug12613) |