diff options
author | tarui <tarui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-20 12:02:37 +0000 |
---|---|---|
committer | tarui <tarui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-20 12:02:37 +0000 |
commit | fbbb06f803611735c9792678f005f9f6953b73af (patch) | |
tree | ae35d74ea68f04431faf8e6ecd8fde1e772af53b | |
parent | 8497a7b9187a05210a4f6b842d06d1268d704d35 (diff) | |
download | ruby-fbbb06f803611735c9792678f005f9f6953b73af.tar.gz |
* 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.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38509 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | vm_trace.c | 6 |
2 files changed, 10 insertions, 2 deletions
@@ -1,3 +1,9 @@ +Thu Dec 20 20:58:25 2012 Masaya Tarui <tarui@ruby-lang.org> + + * 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@ruby-lang.org> * include/ruby/ruby.h (RTEST, NIL_P): make bare expressions without diff --git a/vm_trace.c b/vm_trace.c index 9186983e28..f8fc829fc4 100644 --- a/vm_trace.c +++ b/vm_trace.c @@ -333,7 +333,8 @@ rb_suppress_tracing(VALUE (*func)(VALUE), VALUE arg) 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), VALUE arg) 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); |