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

ruby-changes:44432

From: usa <ko1@a...>
Date: Thu, 27 Oct 2016 16:48:58 +0900 (JST)
Subject: [ruby-changes:44432] usa:r56505 (ruby_2_2): merge revision(s) 56252, 56254: [Backport #12743]

usa	2016-10-27 16:48:53 +0900 (Thu, 27 Oct 2016)

  New Revision: 56505

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

  Log:
    merge revision(s) 56252,56254: [Backport #12743]
    
    * eval_intern.h (TH_PUSH_TAG): Initialize struct rb_vm_tag::tag with
      Qundef rather than 0 which is equal to Qfalse. Since Kernel#throw(obj)
      searches a tag with rb_vm_tag::tag == obj, throw(false) can
      accidentally find an unrelated tag which is not created by
      Kernel#catch.  [ruby-core:77229] [Bug #12743]
    
    * test/ruby/test_exception.rb (test_throw_false): Add a test case for
      this.

  Modified directories:
    branches/ruby_2_2/
  Modified files:
    branches/ruby_2_2/ChangeLog
    branches/ruby_2_2/eval_intern.h
    branches/ruby_2_2/test/ruby/test_exception.rb
    branches/ruby_2_2/version.h
Index: ruby_2_2/eval_intern.h
===================================================================
--- ruby_2_2/eval_intern.h	(revision 56504)
+++ ruby_2_2/eval_intern.h	(revision 56505)
@@ -122,7 +122,7 @@ LONG WINAPI rb_w32_stack_overflow_handle https://github.com/ruby/ruby/blob/trunk/ruby_2_2/eval_intern.h#L122
 #define TH_PUSH_TAG(th) do { \
   rb_thread_t * const _th = (th); \
   struct rb_vm_tag _tag; \
-  _tag.tag = 0; \
+  _tag.tag = Qundef; \
   _tag.prev = _th->tag;
 
 #define TH_POP_TAG() \
Index: ruby_2_2/ChangeLog
===================================================================
--- ruby_2_2/ChangeLog	(revision 56504)
+++ ruby_2_2/ChangeLog	(revision 56505)
@@ -1,3 +1,14 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ChangeLog#L1
+Thu Oct 27 16:47:57 2016  Kazuki Yamaguchi  <k@r...>
+
+	* eval_intern.h (TH_PUSH_TAG): Initialize struct rb_vm_tag::tag with
+	  Qundef rather than 0 which is equal to Qfalse. Since Kernel#throw(obj)
+	  searches a tag with rb_vm_tag::tag == obj, throw(false) can
+	  accidentally find an unrelated tag which is not created by
+	  Kernel#catch.  [ruby-core:77229] [Bug #12743]
+
+	* test/ruby/test_exception.rb (test_throw_false): Add a test case for
+	  this.
+
 Thu Oct 27 16:39:56 2016  Aurelien Jacobs  <aurel@g...>
 
 	* lib/logger.rb (Logger::Period#next_rotate_time): fix monthly log
Index: ruby_2_2/test/ruby/test_exception.rb
===================================================================
--- ruby_2_2/test/ruby/test_exception.rb	(revision 56504)
+++ ruby_2_2/test/ruby/test_exception.rb	(revision 56505)
@@ -180,6 +180,16 @@ class TestException < Test::Unit::TestCa https://github.com/ruby/ruby/blob/trunk/ruby_2_2/test/ruby/test_exception.rb#L180
     }
   end
 
+  def test_throw_false
+    bug12743 = '[ruby-core:77229] [Bug #12743]'
+    e = assert_raise_with_message(UncaughtThrowError, /false/, bug12743) {
+      Thread.start {
+        throw false
+      }.join
+    }
+    assert_same(false, e.tag, bug12743)
+  end
+
   def test_else_no_exception
     begin
       assert(true)
Index: ruby_2_2/version.h
===================================================================
--- ruby_2_2/version.h	(revision 56504)
+++ ruby_2_2/version.h	(revision 56505)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/version.h#L1
 #define RUBY_VERSION "2.2.6"
 #define RUBY_RELEASE_DATE "2016-10-27"
-#define RUBY_PATCHLEVEL 383
+#define RUBY_PATCHLEVEL 384
 
 #define RUBY_RELEASE_YEAR 2016
 #define RUBY_RELEASE_MONTH 10

Property changes on: ruby_2_2
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r56252,56254


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

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