From d90b02360391a2e87dac58329316a87032ae6e70 Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 30 Aug 2012 07:20:05 +0000 Subject: vm_trace.c: warning * vm_trace.c (exec_hooks): supress clobbered warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36855 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm_trace.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'vm_trace.c') diff --git a/vm_trace.c b/vm_trace.c index 16317bdc19..666d3d55e0 100644 --- a/vm_trace.c +++ b/vm_trace.c @@ -280,7 +280,6 @@ clean_hooks(rb_hook_list_t *list) static int exec_hooks(rb_thread_t *th, rb_hook_list_t *list, const rb_trace_arg_t *trace_arg) { - rb_event_hook_t *hook; int state; volatile int raised; @@ -290,13 +289,13 @@ exec_hooks(rb_thread_t *th, rb_hook_list_t *list, const rb_trace_arg_t *trace_ar raised = rb_threadptr_reset_raised(th); - hook = list->hooks; - /* TODO: Support !RUBY_HOOK_FLAG_SAFE hooks */ TH_PUSH_TAG(th); if ((state = TH_EXEC_TAG()) == 0) { - while (hook) { + rb_event_hook_t *hook; + + for (hook = list->hooks; hook; hook = hook->next) { if (LIKELY(!(hook->hook_flags & RUBY_HOOK_FLAG_DELETED)) && (trace_arg->event & hook->events)) { if (!(hook->hook_flags & RUBY_HOOK_FLAG_RAW_ARG)) { (*hook->func)(trace_arg->event, hook->data, trace_arg->self, trace_arg->id, trace_arg->klass); @@ -305,7 +304,6 @@ exec_hooks(rb_thread_t *th, rb_hook_list_t *list, const rb_trace_arg_t *trace_ar (*((rb_event_hook_raw_arg_func_t)hook->func))(hook->data, trace_arg); } } - hook = hook->next; } } TH_POP_TAG(); -- cgit v1.2.3