1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

class.c: fix uninitialized value

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

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44056 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2013-12-08 01:32:07 +00:00
parent 12c8533e1a
commit 100fe2e659

View file

@ -1930,8 +1930,9 @@ rb_get_kwargs(VALUE keyword_hash, const ID *table, int required, int optional, V
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;