зеркало из https://github.com/github/ruby.git
Fix crash when iterating over generic ivars
This commit is contained in:
Родитель
4dd11c067d
Коммит
83da4a7e62
|
@ -207,6 +207,8 @@ class TestShapes < Test::Unit::TestCase
|
|||
tc.instance_variable_set(:@very_unique2, 4)
|
||||
assert_equal 3, tc.instance_variable_get(:@very_unique)
|
||||
assert_equal 4, tc.instance_variable_get(:@very_unique2)
|
||||
|
||||
assert_equal [:@very_unique, :@very_unique2], tc.instance_variables
|
||||
end;
|
||||
end
|
||||
|
||||
|
|
|
@ -1951,7 +1951,7 @@ gen_ivar_each(VALUE obj, rb_ivar_foreach_callback_func *func, st_data_t arg)
|
|||
itr_data.arg = arg;
|
||||
itr_data.func = func;
|
||||
if (rb_shape_obj_too_complex(obj)) {
|
||||
rb_st_foreach((st_table *)ivtbl, each_hash_iv, (st_data_t)&itr_data);
|
||||
rb_st_foreach(ivtbl->as.complex.table, each_hash_iv, (st_data_t)&itr_data);
|
||||
}
|
||||
else {
|
||||
iterate_over_shapes_with_callback(shape, func, &itr_data);
|
||||
|
|
Загрузка…
Ссылка в новой задаче