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

ruby-changes:31977

From: nobu <ko1@a...>
Date: Sun, 8 Dec 2013 10:32:17 +0900 (JST)
Subject: [ruby-changes:31977] nobu:r44056 (trunk): class.c: fix uninitialized value

nobu	2013-12-08 10:32:07 +0900 (Sun, 08 Dec 2013)

  New Revision: 44056

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=44056

  Log:
    class.c: fix uninitialized value
    
    * class.c (rb_get_kwargs): fix returning uninitialized value when no
      optional keywords.

  Modified files:
    trunk/class.c
Index: class.c
===================================================================
--- class.c	(revision 44055)
+++ class.c	(revision 44056)
@@ -1930,8 +1930,9 @@ rb_get_kwargs(VALUE keyword_hash, const https://github.com/ruby/ruby/blob/trunk/class.c#L1930
 	    keyword_error("missing", missing);
 	}
     }
+    j = i;
     if (optional && keyword_hash) {
-	for (j = i, i = 0; i < optional; i++) {
+	for (i = 0; i < optional; i++) {
 	    st_data_t val;
 	    if (st_lookup(rb_hash_tbl_raw(keyword_hash), ID2SYM(table[required+i]), &val)) {
 		if (values) values[required+i] = (VALUE)val;

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

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