diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-09-09 16:16:42 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-09-09 16:16:42 +0000 |
commit | e11c22602af69e8139ec0649bb39f5a66d1e66a1 (patch) | |
tree | 7f9b5fd9e72b5f675209712d45407f41cef791f9 | |
parent | a4a4e8b5a05f69cec077e72a43769e38ef205e23 (diff) | |
parent | d0c717e410cff2fb0d39ca4e113532e84c04f06b (diff) |
add tag v2_4_0_preview2v2_4_0_preview2
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/tags/v2_4_0_preview2@56129 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 19 | ||||
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | doc/extension.ja.rdoc | 2 | ||||
-rw-r--r-- | doc/extension.rdoc | 2 | ||||
-rw-r--r-- | eval.c | 11 | ||||
-rw-r--r-- | gems/bundled_gems | 8 | ||||
-rwxr-xr-x[-rw-r--r--] | test/json/json_generator_test.rb | 5 | ||||
-rw-r--r-- | test/ruby/test_exception.rb | 46 | ||||
-rw-r--r-- | thread.c | 3 |
9 files changed, 90 insertions, 8 deletions
@@ -1,3 +1,22 @@ +Fri Sep 9 22:43:29 2016 Kazuhiro NISHIYAMA <[email protected]> + + * gems/bundled_gems: sort lines. + +Fri Sep 9 17:59:46 2016 Nobuyoshi Nakada <[email protected]> + + * thread.c (rb_threadptr_raise): set cause from the called thread, + but not from the thread to be interrupted. + [ruby-core:77222] [Bug #12741] + +Fri Sep 9 13:50:05 2016 Nobuyoshi Nakada <[email protected]> + + * doc/extension.rdoc, doc/extension.ja.rdoc: fix file name. + pointed out by @takkanm in the RubyKaigi talk. + +Fri Sep 9 13:14:53 2016 Martin Duerst <[email protected]> + + * News: Announcing update to Unicode version 9.0.0 [ci skip] + Fri Sep 9 10:10:00 2016 Nobuyoshi Nakada <[email protected]> * variable.c (rb_const_search): warn with the actual class/module @@ -84,6 +84,8 @@ with all sufficient information, see the ChangeLog file or Redmine * Regexp#match? [Feature #8110] This returns bool and doesn't save backref. +* Regexp/String: Updated Unicode version from 8.0.0 to 9.0.0 [Feature #12513] + * RubyVM::Env * RubyVM::Env was removed. diff --git a/doc/extension.ja.rdoc b/doc/extension.ja.rdoc index 6ecb78cb79..1537054b6c 100644 --- a/doc/extension.ja.rdoc +++ b/doc/extension.ja.rdoc @@ -1,4 +1,4 @@ -# README.EXT.ja - -*- RDoc -*- created at: Mon Aug 7 16:45:54 JST 1995 +# extension.ja.rdoc - -*- RDoc -*- created at: Mon Aug 7 16:45:54 JST 1995 Rubyの拡張ライブラリの作り方を説明します. diff --git a/doc/extension.rdoc b/doc/extension.rdoc index 1e157f824a..28052708e2 100644 --- a/doc/extension.rdoc +++ b/doc/extension.rdoc @@ -1,4 +1,4 @@ -# README.EXT - -*- RDoc -*- created at: Mon Aug 7 16:45:54 JST 1995 +# extension.rdoc - -*- RDoc -*- created at: Mon Aug 7 16:45:54 JST 1995 This document explains how to make extension libraries for Ruby. @@ -567,6 +567,17 @@ setup_exception(rb_thread_t *th, int tag, volatile VALUE mesg, VALUE cause) } } +void +rb_threadptr_setup_exception(rb_thread_t *th, VALUE mesg, VALUE cause) +{ + if (cause == Qundef) { + cause = get_thread_errinfo(th); + } + if (cause != mesg) { + rb_ivar_set(mesg, id_cause, cause); + } +} + static void rb_longjmp(int tag, volatile VALUE mesg, VALUE cause) { diff --git a/gems/bundled_gems b/gems/bundled_gems index d34b6fd3f3..69917d3f88 100644 --- a/gems/bundled_gems +++ b/gems/bundled_gems @@ -1,7 +1,7 @@ -power_assert 0.3.1 -test-unit 3.2.1 +did_you_mean 1.0.2 minitest 5.9.0 -rake 11.2.2 net-telnet 0.1.1 -did_you_mean 1.0.2 +power_assert 0.3.1 +rake 11.2.2 +test-unit 3.2.1 xmlrpc 0.1.1 diff --git a/test/json/json_generator_test.rb b/test/json/json_generator_test.rb index 18b08337f8..86be398f46 100644..100755 --- a/test/json/json_generator_test.rb +++ b/test/json/json_generator_test.rb @@ -277,12 +277,13 @@ EOT if defined?(JSON::Ext::Generator) def test_broken_bignum # [ruby-core:38867] pid = fork do - Bignum.class_eval do + x = 1 << 64 + x.class.class_eval do def to_s end end begin - JSON::Ext::Generator::State.new.generate(1<<64) + JSON::Ext::Generator::State.new.generate(x) exit 1 rescue TypeError exit 0 diff --git a/test/ruby/test_exception.rb b/test/ruby/test_exception.rb index 5023262e5d..03c0c819f5 100644 --- a/test/ruby/test_exception.rb +++ b/test/ruby/test_exception.rb @@ -698,6 +698,52 @@ end.join assert_nil(e.cause.cause) end + def test_cause_thread_no_cause + bug12741 = '[ruby-core:77222] [Bug #12741]' + + x = Thread.current + a = false + y = Thread.start do + Thread.pass until a + x.raise "stop" + end + + begin + raise bug12741 + rescue + e = assert_raise_with_message(RuntimeError, "stop") do + a = true + sleep 1 + end + end + assert_nil(e.cause) + end + + def test_cause_thread_with_cause + bug12741 = '[ruby-core:77222] [Bug #12741]' + + x = Thread.current + a = false + y = Thread.start do + Thread.pass until a + begin + raise "caller's cause" + rescue + x.raise "stop" + end + end + + begin + raise bug12741 + rescue + e = assert_raise_with_message(RuntimeError, "stop") do + a = true + sleep 1 + end + end + assert_equal("caller's cause", e.cause.message) + end + def test_unknown_option bug = '[ruby-core:63203] [Feature #8257] should pass unknown options' @@ -2084,6 +2084,8 @@ rb_threadptr_ready(rb_thread_t *th) rb_threadptr_interrupt(th); } +void rb_threadptr_setup_exception(rb_thread_t *th, VALUE mesg, VALUE cause); + static VALUE rb_threadptr_raise(rb_thread_t *th, int argc, VALUE *argv) { @@ -2099,6 +2101,7 @@ rb_threadptr_raise(rb_thread_t *th, int argc, VALUE *argv) else { exc = rb_make_exception(argc, argv); } + rb_threadptr_setup_exception(GET_THREAD(), exc, Qundef); rb_threadptr_pending_interrupt_enque(th, exc); rb_threadptr_interrupt(th); return Qnil; |