From 3553a86eb51365cc524cf5c549b37770448d550d Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 4 Nov 2015 07:27:10 +0000 Subject: 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 --- ext/readline/readline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/readline/readline.c') 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); -- cgit v1.2.3