From 54726befc3eb52bf06640bfb07664dace3721d14 Mon Sep 17 00:00:00 2001 From: ko1 Date: Tue, 30 Oct 2018 03:21:56 +0000 Subject: use RARRAY_AREF() instead of RARRAY_CONST_PTR(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65438 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- thread_pthread.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'thread_pthread.c') diff --git a/thread_pthread.c b/thread_pthread.c index 368dc0421c..648bf8f3d5 100644 --- a/thread_pthread.c +++ b/thread_pthread.c @@ -1615,18 +1615,17 @@ native_set_thread_name(rb_thread_t *th) SET_CURRENT_THREAD_NAME(RSTRING_PTR(loc)); } else if (!NIL_P(loc = rb_proc_location(th->first_proc))) { - const VALUE *ptr = RARRAY_CONST_PTR(loc); /* [ String, Integer ] */ char *name, *p; char buf[16]; size_t len; int n; - name = RSTRING_PTR(ptr[0]); + name = RSTRING_PTR(RARRAY_AREF(loc, 0)); p = strrchr(name, '/'); /* show only the basename of the path. */ if (p && p[1]) name = p + 1; - n = snprintf(buf, sizeof(buf), "%s:%d", name, NUM2INT(ptr[1])); + n = snprintf(buf, sizeof(buf), "%s:%d", name, NUM2INT(RARRAY_AREF(loc, 1))); rb_gc_force_recycle(loc); /* acts as a GC guard, too */ len = (size_t)n; -- cgit v1.2.3