summaryrefslogtreecommitdiff
path: root/vm_trace.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-01-29 07:51:00 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-01-29 07:51:00 +0000
commit499ca89e24c47cfada7e493a7dfd81cdb9323a45 (patch)
treeb19a55192318638f6e1cabb8e7fb795dafd249d0 /vm_trace.c
parente26c2bc21baac04ab52bff4eeedd9f41e4cb1f31 (diff)
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
Diffstat (limited to 'vm_trace.c')
-rw-r--r--vm_trace.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/vm_trace.c b/vm_trace.c
index 36fa2327ea0..dd68715693d 100644
--- a/vm_trace.c
+++ b/vm_trace.c
@@ -943,7 +943,10 @@ tp_call_trace(VALUE tpval, rb_trace_arg_t *trace_arg)
VALUE
rb_tracepoint_enable(VALUE tpval)
{
- rb_tp_t *tp = tpptr(tpval);
+ rb_tp_t *tp;
+
+ rb_secure(4);
+ tp = tpptr(tpval);
if (tp->target_th) {
rb_thread_add_event_hook2(tp->target_th->self, (rb_event_hook_func_t)tp_call_trace, tp->events, tpval,
@@ -960,7 +963,10 @@ rb_tracepoint_enable(VALUE tpval)
VALUE
rb_tracepoint_disable(VALUE tpval)
{
- rb_tp_t *tp = tpptr(tpval);
+ rb_tp_t *tp;
+
+ rb_secure(4);
+ tp = tpptr(tpval);
if (tp->target_th) {
rb_thread_remove_event_hook_with_data(tp->target_th->self, (rb_event_hook_func_t)tp_call_trace, tpval);