summaryrefslogtreecommitdiff
path: root/class.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-08 01:32:07 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-08 01:32:07 +0000
commit100fe2e659339318846168841fd76ed4e38a6210 (patch)
tree3d3b264750737f559f599d5c5d85a8c287985b3a /class.c
parent12c8533e1a1fda4c5f70727369d379aeb8fe49bb (diff)
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
Diffstat (limited to 'class.c')
-rw-r--r--class.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/class.c b/class.c
index 2c66c39..7e03693 100644
--- a/class.c
+++ b/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;