From e26c2bc21baac04ab52bff4eeedd9f41e4cb1f31 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 29 Jan 2013 07:50:27 +0000 Subject: 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 --- vm_trace.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'vm_trace.c') 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); -- cgit v1.2.3