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

st.c: fix uninitialized variable

* st.c (st_update): old_key is uninitialized by jump to the label
  unpacked.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46725 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2014-07-06 15:22:19 +00:00
parent d74fdfb145
commit 6a9b242a80

6
st.c
View file

@ -821,7 +821,7 @@ st_update(st_table *table, st_data_t key, st_update_callback_func *func, st_data
{
st_index_t hash_val, bin_pos;
register st_table_entry *ptr, **last, *tmp;
st_data_t value = 0;
st_data_t value = 0, old_key;
int retval, existing = 0;
hash_val = do_hash(key, table);
@ -834,7 +834,7 @@ st_update(st_table *table, st_data_t key, st_update_callback_func *func, st_data
existing = 1;
}
{
const st_data_t old_key = key;
old_key = key;
retval = (*func)(&key, &value, arg, existing);
if (!table->entries_packed) {
FIND_ENTRY(table, ptr, hash_val, bin_pos);
@ -867,7 +867,7 @@ st_update(st_table *table, st_data_t key, st_update_callback_func *func, st_data
existing = 1;
}
{
const st_data_t old_key = key;
old_key = key;
retval = (*func)(&key, &value, arg, existing);
unpacked:
switch (retval) {