[前][次][番号順一覧][スレッド一覧]

ruby-changes:43048

From: naruse <ko1@a...>
Date: Mon, 23 May 2016 12:23:28 +0900 (JST)
Subject: [ruby-changes:43048] naruse:r55122 (trunk): * array.c (rb_ary_fill): suppress warnings: 'item' may be used

naruse	2016-05-23 12:23:24 +0900 (Mon, 23 May 2016)

  New Revision: 55122

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=55122

  Log:
    * array.c (rb_ary_fill): suppress warnings: 'item' may be used
      uninitialized in this function

  Modified files:
    trunk/ChangeLog
    trunk/array.c
Index: array.c
===================================================================
--- array.c	(revision 55121)
+++ array.c	(revision 55122)
@@ -3520,12 +3520,10 @@ rb_ary_clear(VALUE ary) https://github.com/ruby/ruby/blob/trunk/array.c#L3520
 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 https://github.com/ruby/ruby/blob/trunk/array.c#L3565
 	ARY_SET_LEN(ary, end);
     }
 
-    if (block_p) {
+    if (item == Qundef) {
 	VALUE v;
 	long i;
 
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 55121)
+++ ChangeLog	(revision 55122)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Mon May 23 12:21:18 2016  NARUSE, Yui  <naruse@r...>
+
+	* 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@8...>
 
 	* dir.c (dir_close): update RDoc for 2.3 #close change

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]