From def62c3267e64128cc4f5aab187dad75bd7b2c39 Mon Sep 17 00:00:00 2001 From: ko1 Date: Tue, 24 Dec 2013 03:13:52 +0000 Subject: * include/ruby/ruby.h (RARRAY_ASET): try to avoid compiler warning. [Bug #9287] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- include/ruby/ruby.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include/ruby') diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h index cad402a201..6c6cee25c1 100644 --- a/include/ruby/ruby.h +++ b/include/ruby/ruby.h @@ -900,8 +900,10 @@ struct RArray { #define RARRAY_AREF(a, i) (RARRAY_CONST_PTR(a)[i]) #define RARRAY_ASET(a, i, v) do { \ - const VALUE _ary_ = (a); \ - RB_OBJ_WRITE(_ary_, &RARRAY_CONST_PTR(_ary_)[i], (v)); \ + const VALUE _ary = (a); \ + VALUE *ptr = (VALUE *)RARRAY_PTR_USE_START(_ary); \ + RB_OBJ_WRITE(_ary, &ptr[i], (v)); \ + RARRAY_PTR_USE_END(_ary); \ } while (0) #define RARRAY_PTR(a) ((VALUE *)RARRAY_CONST_PTR(RGENGC_WB_PROTECTED_ARRAY ? OBJ_WB_UNPROTECT((VALUE)a) : ((VALUE)a))) -- cgit v1.2.3