diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-07-30 15:52:15 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-07-30 15:52:15 +0000 |
commit | cd1f00780b2a412dcb01fcd5abd46df3a547e788 (patch) | |
tree | 4209039f3fab9b6bb73a652dac3b433006479b34 /test/ruby | |
parent | 3eb0620c2a901b12e6fb752fd1ae668ed8f2b918 (diff) |
merge revision(s) r46419,r46429: [Backport #9940]
* 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.
* thread.c: added
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@47009 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_settracefunc.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_settracefunc.rb b/test/ruby/test_settracefunc.rb index 79f315edd5..818cf0f0b5 100644 --- a/test/ruby/test_settracefunc.rb +++ b/test/ruby/test_settracefunc.rb @@ -1182,6 +1182,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 |