vm_trace.c: TracePoint safe level check

* vm_trace.c (rb_tracepoint_enable, rb_tracepoint_disable): check safe
  level as well as set_trace_func.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38969 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2013-01-29 07:51:00 +00:00
parent e26c2bc21b
commit 499ca89e24
3 changed files with 26 additions and 3 deletions

View file

@ -919,4 +919,18 @@ class TestSetTraceFunc < Test::Unit::TestCase
assert_equal([:b_call, :b_return], ary, bug_7668)
end
end
def test_trace_point_enable_safe4
tp = TracePoint.new {}
assert_security_error_safe4 do
tp.enable
end
end
def test_trace_point_disable_safe4
tp = TracePoint.new {}
assert_security_error_safe4 do
tp.disable
end
end
end