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

ruby-changes:26458

From: tarui <ko1@a...>
Date: Thu, 20 Dec 2012 21:02:47 +0900 (JST)
Subject: [ruby-changes:26458] tarui:r38509 (trunk): * vm_trace.c (rb_suppress_tracing): bugfix for vm->trace_running

tarui	2012-12-20 21:02:37 +0900 (Thu, 20 Dec 2012)

  New Revision: 38509

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

  Log:
    * vm_trace.c (rb_suppress_tracing): bugfix for vm->trace_running
      counter. And if tracing is already true, vm_trace_running ops is
      skipped to control overflow.

  Modified files:
    trunk/ChangeLog
    trunk/vm_trace.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 38508)
+++ ChangeLog	(revision 38509)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Thu Dec 20 20:58:25 2012  Masaya Tarui  <tarui@r...>
+
+        * vm_trace.c (rb_suppress_tracing): bugfix for vm->trace_running
+	  counter. And if tracing is already true, vm_trace_running ops is
+	  skipped to control overflow.
+
 Thu Dec 20 18:29:54 2012  Nobuyoshi Nakada  <nobu@r...>
 
 	* include/ruby/ruby.h (RTEST, NIL_P): make bare expressions without
Index: vm_trace.c
===================================================================
--- vm_trace.c	(revision 38508)
+++ vm_trace.c	(revision 38509)
@@ -333,7 +333,8 @@ rb_suppress_tracing(VALUE (*func)(VALUE) https://github.com/ruby/ruby/blob/trunk/vm_trace.c#L333
     const int vm_tracing = th->vm->trace_running;
     const int tracing = th->trace_running;
 
-    th->vm->trace_running = 1;
+    if(!tracing)
+	th->vm->trace_running++;
     th->trace_running = 1;
     raised = rb_threadptr_reset_raised(th);
     outer_state = th->state;
@@ -349,7 +350,8 @@ rb_suppress_tracing(VALUE (*func)(VALUE) https://github.com/ruby/ruby/blob/trunk/vm_trace.c#L350
 	rb_threadptr_set_raised(th);
     }
     th->trace_running = tracing;
-    th->vm->trace_running = vm_tracing;
+    if(!tracing)
+	th->vm->trace_running--;
 
     if (state) {
 	JUMP_TAG(state);

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

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