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

ruby-changes:17156

From: nobu <ko1@a...>
Date: Wed, 1 Sep 2010 12:56:46 +0900 (JST)
Subject: [ruby-changes:17156] Ruby:r29155 (trunk): * thread.c (ruby_suppress_tracing): restore the state and invoke

nobu	2010-09-01 12:56:39 +0900 (Wed, 01 Sep 2010)

  New Revision: 29155

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=29155

  Log:
    * thread.c (ruby_suppress_tracing): restore the state and invoke
      the func with normal state.  a patch from Satoshi Shiba <shiba
      AT rvm.jp> at [ruby-dev:42162].  [ruby-core:31783]

  Modified files:
    trunk/ChangeLog
    trunk/test/ruby/test_trace.rb
    trunk/thread.c
    trunk/version.h

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 29154)
+++ ChangeLog	(revision 29155)
@@ -1,3 +1,9 @@
+Wed Sep  1 12:56:36 2010  Nobuyoshi Nakada  <nobu@r...>
+
+	* thread.c (ruby_suppress_tracing): restore the state and invoke
+	  the func with normal state.  a patch from Satoshi Shiba <shiba
+	  AT rvm.jp> at [ruby-dev:42162].  [ruby-core:31783]
+
 Tue Aug 31 21:10:23 2010  Tanaka Akira  <akr@f...>
 
 	* ext/pathname/pathname.c (path_exist_p): Pathname#exist? translated
Index: thread.c
===================================================================
--- thread.c	(revision 29154)
+++ thread.c	(revision 29155)
@@ -4099,6 +4099,7 @@
     rb_thread_t *th = GET_THREAD();
     int state, tracing;
     volatile int raised;
+    volatile int outer_state;
     VALUE result = Qnil;
 
     if ((tracing = th->tracing) != 0 && !always) {
@@ -4109,6 +4110,8 @@
     }
 
     raised = rb_threadptr_reset_raised(th);
+    outer_state = th->state;
+    th->state = 0;
 
     PUSH_TAG();
     if ((state = EXEC_TAG()) == 0) {
@@ -4124,6 +4127,7 @@
     if (state) {
 	JUMP_TAG(state);
     }
+    th->state = outer_state;
 
     return result;
 }
Index: version.h
===================================================================
--- version.h	(revision 29154)
+++ version.h	(revision 29155)
@@ -1,11 +1,11 @@
 #define RUBY_VERSION "1.9.3"
-#define RUBY_RELEASE_DATE "2010-08-31"
+#define RUBY_RELEASE_DATE "2010-09-01"
 #define RUBY_PATCHLEVEL -1
 #define RUBY_BRANCH_NAME "trunk"
 
 #define RUBY_RELEASE_YEAR 2010
-#define RUBY_RELEASE_MONTH 8
-#define RUBY_RELEASE_DAY 31
+#define RUBY_RELEASE_MONTH 9
+#define RUBY_RELEASE_DAY 1
 
 #include "ruby/version.h"
 
Index: test/ruby/test_trace.rb
===================================================================
--- test/ruby/test_trace.rb	(revision 29154)
+++ test/ruby/test_trace.rb	(revision 29155)
@@ -46,4 +46,16 @@
   ensure
     untrace_var :$x
   end
+
+  def test_trace_break
+    bug2722 = '[ruby-core:31783]'
+    a = Object.new.extend(Enumerable)
+    def a.each
+      yield
+    end
+    assert(Thread.start {
+             Thread.current.add_trace_func(proc{})
+             a.any? {true}
+           }.value, bug2722)
+  end
 end

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

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