diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-11-04 07:27:10 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-11-04 07:27:10 +0000 |
commit | 3553a86eb51365cc524cf5c549b37770448d550d (patch) | |
tree | 9a96e1d3ccc6de7a94b8d884ddb946b3c3701de3 /ext/readline/readline.c | |
parent | 52912db4a81f9b9b69ab9e9fcd95e22d086d4289 (diff) |
ext: use RARRAY_CONST_PTR
* ext/bigdecimal/bigdecimal.c: use RARRAY_CONST_PTR just fore
reference instead of RARRAY_PTR, to keep the array WB-protected.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52448 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/readline/readline.c')
-rw-r--r-- | ext/readline/readline.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/readline/readline.c b/ext/readline/readline.c index 754f981c1a..6aa9177892 100644 --- a/ext/readline/readline.c +++ b/ext/readline/readline.c @@ -963,7 +963,7 @@ readline_attempted_completion_function(const char *text, int start, int end) enc = rb_locale_encoding(); encobj = rb_enc_from_encoding(enc); for (i = 0; i < matches; i++) { - temp = rb_obj_as_string(RARRAY_PTR(ary)[i]); + temp = rb_obj_as_string(RARRAY_CONST_PTR(ary)[i]); StringValueCStr(temp); /* must be NUL-terminated */ rb_enc_check(encobj, temp); result[i + 1] = (char*)malloc(RSTRING_LEN(temp) + 1); |