ruby-changes:47374
From: nagachika <ko1@a...>
Date: Thu, 3 Aug 2017 23:00:46 +0900 (JST)
Subject: [ruby-changes:47374] nagachika:r59490 (ruby_2_4): merge revision(s) 59169: [Backport #13678]
nagachika 2017-08-03 23:00:41 +0900 (Thu, 03 Aug 2017) New Revision: 59490 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=59490 Log: merge revision(s) 59169: [Backport #13678] compile.c: toplevel return in argument * compile.c (iseq_compile_each0): adjust the stack before return in an evstr/argument (reported by Balazs <balazs@k...>) to fix stack consistency error. [ruby-core:81761] [Bug #13678] Modified directories: branches/ruby_2_4/ Modified files: branches/ruby_2_4/compile.c branches/ruby_2_4/test/ruby/test_syntax.rb branches/ruby_2_4/version.h Index: ruby_2_4/version.h =================================================================== --- ruby_2_4/version.h (revision 59489) +++ ruby_2_4/version.h (revision 59490) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_4/version.h#L1 #define RUBY_VERSION "2.4.2" #define RUBY_RELEASE_DATE "2017-08-03" -#define RUBY_PATCHLEVEL 163 +#define RUBY_PATCHLEVEL 164 #define RUBY_RELEASE_YEAR 2017 #define RUBY_RELEASE_MONTH 8 Index: ruby_2_4/test/ruby/test_syntax.rb =================================================================== --- ruby_2_4/test/ruby/test_syntax.rb (revision 59489) +++ ruby_2_4/test/ruby/test_syntax.rb (revision 59490) @@ -964,7 +964,7 @@ eom https://github.com/ruby/ruby/blob/trunk/ruby_2_4/test/ruby/test_syntax.rb#L964 def test_return_toplevel feature4840 = '[ruby-core:36785] [Feature #4840]' - code = "#{<<~"begin;"}\n#{<<~"end;"}" + code = "#{<<~"begin;"}\n#{<<~'end;'}" begin; return; raise begin return; rescue SystemExit; exit false; end @@ -974,6 +974,8 @@ eom https://github.com/ruby/ruby/blob/trunk/ruby_2_4/test/ruby/test_syntax.rb#L974 begin raise; rescue; return; end return false; raise return 1; raise + "#{return}" + raise((return; "should not raise")) end; all_assertions(feature4840) do |a| code.each_line do |s| Index: ruby_2_4/compile.c =================================================================== --- ruby_2_4/compile.c (revision 59489) +++ ruby_2_4/compile.c (revision 59490) @@ -5479,6 +5479,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ https://github.com/ruby/ruby/blob/trunk/ruby_2_4/compile.c#L5479 if (type == ISEQ_TYPE_TOP || type == ISEQ_TYPE_MAIN || ((type == ISEQ_TYPE_RESCUE || type == ISEQ_TYPE_ENSURE) && (parent_type == ISEQ_TYPE_TOP || parent_type == ISEQ_TYPE_MAIN))) { + ADD_ADJUST(ret, line, 0); ADD_INSN(ret, line, putnil); ADD_INSN(ret, line, leave); } Index: ruby_2_4 =================================================================== --- ruby_2_4 (revision 59489) +++ ruby_2_4 (revision 59490) Property changes on: ruby_2_4 ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /trunk:r59169 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/