[前][次][番号順一覧][スレッド一覧]

ruby-changes:55185

From: usa <ko1@a...>
Date: Mon, 1 Apr 2019 00:01:17 +0900 (JST)
Subject: [ruby-changes:55185] usa:r67392 (ruby_2_4): merge revision(s) 67201: [Backport #15650]

usa	2019-04-01 00:01:13 +0900 (Mon, 01 Apr 2019)

  New Revision: 67392

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=67392

  Log:
    merge revision(s) 67201: [Backport #15650]
    
    eval.c: clear internal errinfo
    
    * eval.c (ruby_cleanup): clear internal error info when invoking
      end procs.  [ruby-core:91731] [Bug #15650]

  Modified directories:
    branches/ruby_2_4/
  Modified files:
    branches/ruby_2_4/eval.c
    branches/ruby_2_4/test/ruby/test_beginendblock.rb
    branches/ruby_2_4/version.h
Index: ruby_2_4/test/ruby/test_beginendblock.rb
===================================================================
--- ruby_2_4/test/ruby/test_beginendblock.rb	(revision 67391)
+++ ruby_2_4/test/ruby/test_beginendblock.rb	(revision 67392)
@@ -148,4 +148,26 @@ EOS https://github.com/ruby/ruby/blob/trunk/ruby_2_4/test/ruby/test_beginendblock.rb#L148
       end
     end;
   end
+
+  if defined?(fork)
+    def test_internal_errinfo_at_exit
+      # TODO: use other than break-in-fork to throw an internal
+      # error info.
+      error, pid, status = IO.pipe do |r, w|
+        pid = fork do
+          r.close
+          STDERR.reopen(w)
+          at_exit do
+            $!.class
+          end
+          break
+        end
+        w.close
+        [r.read, *Process.wait2(pid)]
+      end
+      assert_not_predicate(status, :success?)
+      assert_not_predicate(status, :signaled?)
+      assert_match(/unexpected break/, error)
+    end
+  end
 end
Index: ruby_2_4/eval.c
===================================================================
--- ruby_2_4/eval.c	(revision 67391)
+++ ruby_2_4/eval.c	(revision 67392)
@@ -173,6 +173,7 @@ ruby_cleanup(volatile int ex) https://github.com/ruby/ruby/blob/trunk/ruby_2_4/eval.c#L173
 
       step_0: step++;
 	errs[1] = th->errinfo;
+	if (THROW_DATA_P(th->errinfo)) th->errinfo = Qnil;
 	th->safe_level = 0;
 	ruby_init_stack(&errs[STACK_UPPER(errs, 0, 1)]);
 
Index: ruby_2_4/version.h
===================================================================
--- ruby_2_4/version.h	(revision 67391)
+++ ruby_2_4/version.h	(revision 67392)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_4/version.h#L1
 #define RUBY_VERSION "2.4.6"
 #define RUBY_RELEASE_DATE "2019-03-31"
-#define RUBY_PATCHLEVEL 353
+#define RUBY_PATCHLEVEL 354
 
 #define RUBY_RELEASE_YEAR 2019
 #define RUBY_RELEASE_MONTH 3
Index: ruby_2_4
===================================================================
--- ruby_2_4	(revision 67391)
+++ ruby_2_4	(revision 67392)

Property changes on: ruby_2_4
___________________________________________________________________
Modified: svn:mergeinfo
## -0,0 +0,1 ##
   Merged /trunk:r67201

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]