summaryrefslogtreecommitdiff
path: root/vm_trace.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-01-29 07:50:27 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-01-29 07:50:27 +0000
commite26c2bc21baac04ab52bff4eeedd9f41e4cb1f31 (patch)
treecaf89974265b2d39ab74bf784009f0b52a4f8b4c /vm_trace.c
parentb0c4ac77799fdf60a489f9e735158647c630865a (diff)
downloadruby-e26c2bc21baac04ab52bff4eeedd9f41e4cb1f31.tar.gz
vm_trace.c: trace_func safe level check
* vm_trace.c (set_trace_func, thread_{add,set}_trace_func_m): check safe level as well as 1.8. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_trace.c')
-rw-r--r--vm_trace.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/vm_trace.c b/vm_trace.c
index 9165e37bf3..36fa2327ea 100644
--- a/vm_trace.c
+++ b/vm_trace.c
@@ -443,6 +443,8 @@ static void call_trace_func(rb_event_flag_t, VALUE data, VALUE self, ID id, VALU
static VALUE
set_trace_func(VALUE obj, VALUE trace)
{
+ rb_secure(4);
+
rb_remove_event_hook(call_trace_func);
if (NIL_P(trace)) {
@@ -479,6 +481,8 @@ static VALUE
thread_add_trace_func_m(VALUE obj, VALUE trace)
{
rb_thread_t *th;
+
+ rb_secure(4);
GetThreadPtr(obj, th);
thread_add_trace_func(th, trace);
return trace;
@@ -498,6 +502,8 @@ static VALUE
thread_set_trace_func_m(VALUE obj, VALUE trace)
{
rb_thread_t *th;
+
+ rb_secure(4);
GetThreadPtr(obj, th);
rb_threadptr_remove_event_hook(th, call_trace_func, Qundef);