diff --git a/gems/bundled_gems b/gems/bundled_gems index fcf63ab603ac6b..e709d57b793039 100644 --- a/gems/bundled_gems +++ b/gems/bundled_gems @@ -13,7 +13,7 @@ test-unit 3.7.7 https://github.com/test-unit/test-unit rexml 3.4.4 https://github.com/ruby/rexml rss 0.3.2 https://github.com/ruby/rss net-ftp 0.3.9 https://github.com/ruby/net-ftp -net-imap 0.6.2 https://github.com/ruby/net-imap +net-imap 0.6.2 https://github.com/ruby/net-imap d9ae35ef913a45f83387b8444cdce4fb1cbf01af net-pop 0.1.2 https://github.com/ruby/net-pop net-smtp 0.5.1 https://github.com/ruby/net-smtp matrix 0.4.3 https://github.com/ruby/matrix diff --git a/struct.c b/struct.c index 667d35424fb8d1..31df3798cbcb4b 100644 --- a/struct.c +++ b/struct.c @@ -1809,6 +1809,7 @@ rb_data_initialize_m(int argc, const VALUE *argv, VALUE self) if (num_members > 0) { rb_exc_raise(rb_keyword_error_new("missing", members)); } + OBJ_FREEZE(self); return Qnil; } if (argc > 1 || !RB_TYPE_P(argv[0], T_HASH)) { diff --git a/test/ruby/test_data.rb b/test/ruby/test_data.rb index dd698fdcc4a30e..5ac4c6b84b66aa 100644 --- a/test/ruby/test_data.rb +++ b/test/ruby/test_data.rb @@ -262,6 +262,7 @@ def test_memberless assert_equal('#', test.inspect) assert_equal([], test.members) assert_equal({}, test.to_h) + assert_predicate(test, :frozen?) end def test_dup