From 249790802db62ff22c79830d4054c449fa3c243b Mon Sep 17 00:00:00 2001 From: ko1 Date: Wed, 28 Jun 2017 04:49:30 +0000 Subject: introduce rb_thread_ptr() to replace GetThreadPtr(). * vm_core.h (rb_thread_ptr): added to replace GetThreadPtr() macro. * thread.c (in some functions: use "target_th" instead of "th" to make clear that it is not a current thread. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59192 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm_backtrace.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'vm_backtrace.c') diff --git a/vm_backtrace.c b/vm_backtrace.c index ed0b33c8da..aab62ea072 100644 --- a/vm_backtrace.c +++ b/vm_backtrace.c @@ -889,13 +889,12 @@ threadptr_backtrace_to_ary(rb_thread_t *th, int argc, const VALUE *argv, int lev static VALUE thread_backtrace_to_ary(int argc, const VALUE *argv, VALUE thval, int to_str) { - rb_thread_t *th; - GetThreadPtr(thval, th); + rb_thread_t *target_th = rb_thread_ptr(thval); - if (th->to_kill || th->status == THREAD_KILLED) - return Qnil; + if (target_th->to_kill || target_th->status == THREAD_KILLED) + return Qnil; - return threadptr_backtrace_to_ary(th, argc, argv, 0, 0, to_str); + return threadptr_backtrace_to_ary(target_th, argc, argv, 0, 0, to_str); } VALUE -- cgit v1.2.3