summaryrefslogtreecommitdiff
path: root/vm_backtrace.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-06-28 04:49:30 (GMT)
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-06-28 04:49:30 (GMT)
commit249790802db62ff22c79830d4054c449fa3c243b (patch)
treec0ee96bf9da5df9607397c841b2b7953a41d4c04 /vm_backtrace.c
parente42a16190c0c5bbdbe052b62c3a8b67920b3d08f (diff)
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
Diffstat (limited to 'vm_backtrace.c')
-rw-r--r--vm_backtrace.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/vm_backtrace.c b/vm_backtrace.c
index ed0b33c..aab62ea 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