aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_settracefunc.rb
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-06-13 08:50:11 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-06-13 08:50:11 +0000
commitddae6a05d7442f25ac04eb3338ffa8a8b4895d3f (patch)
tree5a69624215e1a163a8ff7bcc583aa43edcdb1b60 /test/ruby/test_settracefunc.rb
parent537b4a64227aebf357a5c3f570e01be5f2f824fd (diff)
downloadruby-ddae6a05d7442f25ac04eb3338ffa8a8b4895d3f.tar.gz
* vm_trace.c: clear and restore recursive checking thread local data
to avoid unexpected throw from TracePoint. [Bug #9940] * test/ruby/test_settracefunc.rb: add a test. * thread.c: adde * rb_threadptr_reset_recursive_data(rb_thread_t *th); * rb_threadptr_restore_recursive_data(rb_thread_t *th, VALUE old); * vm_core.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_settracefunc.rb')
-rw-r--r--test/ruby/test_settracefunc.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_settracefunc.rb b/test/ruby/test_settracefunc.rb
index 9837448ce4..970c1a650e 100644
--- a/test/ruby/test_settracefunc.rb
+++ b/test/ruby/test_settracefunc.rb
@@ -1188,6 +1188,18 @@ class TestSetTraceFunc < Test::Unit::TestCase
assert_equal([['call', :foo], ['return', :foo]], events, 'Bug #9759')
ensure
end
+ end
+ def test_recursive
+ assert_ruby_status [], %q{
+ stack = []
+ TracePoint.new(:c_call){|tp|
+ p 2
+ stack << tp.method_id
+ }.enable{
+ p 1
+ }
+ raise if stack != [:p, :hash, :inspect]
+ }, '[Bug #9940]'
end
end