diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-01-29 07:50:27 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-01-29 07:50:27 +0000 |
commit | e26c2bc21baac04ab52bff4eeedd9f41e4cb1f31 (patch) | |
tree | caf89974265b2d39ab74bf784009f0b52a4f8b4c /vm_trace.c | |
parent | b0c4ac77799fdf60a489f9e735158647c630865a (diff) | |
download | ruby-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.c | 6 |
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); |