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

ruby-changes:71391

From: nagachika <ko1@a...>
Date: Sun, 13 Mar 2022 12:12:22 +0900 (JST)
Subject: [ruby-changes:71391] 42b1e87ba7 (ruby_3_0): merge revision(s) ae5458f228a5477383e9c00425d85d50a3867817: [Backport #18475]

https://git.ruby-lang.org/ruby.git/commit/?id=42b1e87ba7

From 42b1e87ba7856f92973924985a63a60b5fa750c8 Mon Sep 17 00:00:00 2001
From: nagachika <nagachika@r...>
Date: Sun, 13 Mar 2022 11:37:03 +0900
Subject: merge revision(s) ae5458f228a5477383e9c00425d85d50a3867817: [Backport
 #18475]

	thread.c: Convert TAG_BREAK to a normal exception at thread top-level

	[Bug #18475]
	---
	 test/ruby/test_enum.rb | 11 +++++++++++
	 thread.c               |  3 +++
	 2 files changed, 14 insertions(+)
---
 test/ruby/test_enum.rb | 11 +++++++++++
 thread.c               |  3 +++
 version.h              |  4 ++--
 3 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/test/ruby/test_enum.rb b/test/ruby/test_enum.rb
index f246828e61..c527191eff 100644
--- a/test/ruby/test_enum.rb
+++ b/test/ruby/test_enum.rb
@@ -421,6 +421,17 @@ class TestEnumerable < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_enum.rb#L421
       empty.first
       empty.block.call
     end;
+
+    bug18475 = '[ruby-dev:107059]'
+    assert_in_out_err([], <<-'end;', [], /unexpected break/, bug18475)
+      e = Enumerator.new do |g|
+        Thread.new do
+          g << 1
+        end.join
+      end
+
+      e.first
+    end;
   end
 
   def test_sort
diff --git a/thread.c b/thread.c
index 6f4be7d62f..59279ef8ff 100644
--- a/thread.c
+++ b/thread.c
@@ -835,6 +835,9 @@ thread_start_func_2(rb_thread_t *th, VALUE *stack_start) https://github.com/ruby/ruby/blob/trunk/thread.c#L835
     } else {
         errinfo = th->ec->errinfo;
 
+        VALUE exc = rb_vm_make_jump_tag_but_local_jump(state, Qundef);
+        if (!NIL_P(exc)) errinfo = exc;
+
         if (state == TAG_FATAL) {
             if (th->invoke_type == thread_invoke_type_ractor_proc) {
                 rb_ractor_atexit(th->ec, Qnil);
diff --git a/version.h b/version.h
index f13ae3c33f..ade88256a4 100644
--- a/version.h
+++ b/version.h
@@ -12,11 +12,11 @@ https://github.com/ruby/ruby/blob/trunk/version.h#L12
 # define RUBY_VERSION_MINOR RUBY_API_VERSION_MINOR
 #define RUBY_VERSION_TEENY 4
 #define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR
-#define RUBY_PATCHLEVEL 189
+#define RUBY_PATCHLEVEL 190
 
 #define RUBY_RELEASE_YEAR 2022
 #define RUBY_RELEASE_MONTH 3
-#define RUBY_RELEASE_DAY 12
+#define RUBY_RELEASE_DAY 13
 
 #include "ruby/version.h"
 
-- 
cgit v1.2.1


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

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