From 2a66cc554db6263bc04c804ad62750497c26a772 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 2 Dec 2015 07:27:22 +0000 Subject: encoding.c: defer finding encoding * encoding.c (enc_m_loader): defer finding encoding object not to be infected by marshal source. [ruby-core:71793] [Bug #11760] * marshal.c (r_object0): enable compatible loader on USERDEF class. the loader function is called with the class itself, instead of an allocated object, and the loaded data. * marshal.c (compat_allocator_table): intialize compat_allocator_tbl on demand. * object.c (rb_undefined_alloc): extract from rb_obj_alloc. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52856 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_encoding.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_encoding.rb b/test/ruby/test_encoding.rb index 63c56e2cd3..abe4317ff6 100644 --- a/test/ruby/test_encoding.rb +++ b/test/ruby/test_encoding.rb @@ -33,6 +33,9 @@ class TestEncoding < Test::Unit::TestCase assert_raise(TypeError) { e.dup } assert_raise(TypeError) { e.clone } assert_equal(e.object_id, Marshal.load(Marshal.dump(e)).object_id) + assert_not_predicate(e, :tainted?) + Marshal.load(Marshal.dump(e).taint) + assert_not_predicate(e, :tainted?, '[ruby-core:71793] [Bug #11760]') end end -- cgit v1.2.3