summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-24 03:13:52 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-24 03:13:52 +0000
commitdef62c3267e64128cc4f5aab187dad75bd7b2c39 (patch)
treeab329cb3d63f047119505f92fcc8bb97c9c58988
parenta137f4ed3a23c5e96ca09d7c8cf5108573a81233 (diff)
* 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
-rw-r--r--ChangeLog5
-rw-r--r--include/ruby/ruby.h6
2 files changed, 9 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 1541a04a8b..9b52a9af12 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Dec 24 12:11:43 2013 Koichi Sasada <ko1@atdot.net>
+
+ * include/ruby/ruby.h (RARRAY_ASET): try to avoid compiler warning.
+ [Bug #9287]
+
Tue Dec 24 05:04:56 2013 NAKAMURA Usaku <usa@ruby-lang.org>
* test/fileutils/test_fileutils.rb (setup): should not call
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)))