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:
parent
12c8533e1a
commit
100fe2e659
1 changed files with 2 additions and 1 deletions
3
class.c
3
class.c
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue