From cb2a99822e3260fa664a24d96841e21767b9f50b Mon Sep 17 00:00:00 2001 From: naruse Date: Mon, 23 May 2016 03:23:24 +0000 Subject: [PATCH] * 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 --- ChangeLog | 5 +++++ array.c | 6 ++---- 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 + + * array.c (rb_ary_fill): suppress warnings: 'item' may be used + uninitialized in this function + Mon May 23 07:41:49 2016 Eric Wong * 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;