summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-23 03:23:24 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-23 03:23:24 +0000
commitcb2a99822e3260fa664a24d96841e21767b9f50b (patch)
treeb7fe198ff8dbdc8396a2525fe97c4b6afbb60be1
parentf00ec4fb386f44d84d750e841f2c240d0a14e968 (diff)
* array.c (rb_ary_fill): suppress warnings: 'item' may be used
uninitialized in this function git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55122 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--array.c6
2 files changed, 7 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 065612a235..de2e739447 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Mon May 23 12:21:18 2016 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * array.c (rb_ary_fill): suppress warnings: 'item' may be used
+ uninitialized in this function
+
Mon May 23 07:41:49 2016 Eric Wong <e@80x24.org>
* dir.c (dir_close): update RDoc for 2.3 #close change
diff --git a/array.c b/array.c
index 11fba55029..6f1d65a88e 100644
--- a/array.c
+++ b/array.c
@@ -3520,12 +3520,10 @@ rb_ary_clear(VALUE ary)
static VALUE
rb_ary_fill(int argc, VALUE *argv, VALUE ary)
{
- VALUE item, arg1, arg2;
+ VALUE item = Qundef, arg1, arg2;
long beg = 0, end = 0, len = 0;
- int block_p = FALSE;
if (rb_block_given_p()) {
- block_p = TRUE;
rb_scan_args(argc, argv, "02", &arg1, &arg2);
argc += 1; /* hackish */
}
@@ -3567,7 +3565,7 @@ rb_ary_fill(int argc, VALUE *argv, VALUE ary)
ARY_SET_LEN(ary, end);
}
- if (block_p) {
+ if (item == Qundef) {
VALUE v;
long i;