summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-09-09 16:16:42 (GMT)
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-09-09 16:16:42 (GMT)
commite11c22602af69e8139ec0649bb39f5a66d1e66a1 (patch)
tree7f9b5fd9e72b5f675209712d45407f41cef791f9
parenta4a4e8b5a05f69cec077e72a43769e38ef205e23 (diff)
parentd0c717e410cff2fb0d39ca4e113532e84c04f06b (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--ChangeLog19
-rw-r--r--NEWS2
-rw-r--r--doc/extension.ja.rdoc2
-rw-r--r--doc/extension.rdoc2
-rw-r--r--eval.c11
-rw-r--r--gems/bundled_gems8
-rwxr-xr-x[-rw-r--r--]test/json/json_generator_test.rb5
-rw-r--r--test/ruby/test_exception.rb46
-rw-r--r--thread.c3
9 files changed, 90 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 284eb61..1fd1fd9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+Fri Sep 9 22:43:29 2016 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * gems/bundled_gems: sort lines.
+
+Fri Sep 9 17:59:46 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * 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 <nobu@ruby-lang.org>
+
+ * 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 <duerst@it.aoyama.ac.jp>
+
+ * News: Announcing update to Unicode version 9.0.0 [ci skip]
+
Fri Sep 9 10:10:00 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
* variable.c (rb_const_search): warn with the actual class/module
diff --git a/NEWS b/NEWS
index 6a9dbd3..986db32 100644
--- a/NEWS
+++ b/NEWS
@@ -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 6ecb78c..1537054 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 1e157f8..2805270 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.
diff --git a/eval.c b/eval.c
index bad3c83..1baf914 100644
--- a/eval.c
+++ b/eval.c
@@ -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 d34b6fd..69917d3 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 18b0833..86be398 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 5023262..03c0c81 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'
diff --git a/thread.c b/thread.c
index 6404bd2..46077f6 100644
--- a/thread.c
+++ b/thread.c
@@ -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;