From e04046515389ba4d019a13db33de198b85480b00 Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 15 Sep 2018 16:27:06 +0000 Subject: encoding.c: check external encoding * encoding.c (rb_enc_get_index): external encoding may not be Data object. [ruby-core:89016] [Bug #15122] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64753 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_io.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test') diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index 27077b425b..eeda96c9ef 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -3855,4 +3855,11 @@ __END__ th.join end; end + + def test_external_encoding_index + IO.pipe {|r, w| + assert_raise(TypeError) {Marshal.dump(r)} + assert_raise(TypeError) {Marshal.dump(w)} + } + end end -- cgit v1.2.3