From c31e7c1e8b2895ef33204938487597e2b3acaaf7 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 2 Mar 2012 02:45:35 +0000 Subject: merge revision(s) 25230,34866: * marshal.c (struct {dump,load}_arg): manage with dfree, instead of using local variable which may be moved by context switch. [ruby-dev:39425] * marshal.c (mark_dump_arg): mark destination string. patch by Vit Ondruch. [Bug #4339] * marshal.c (clear_dump_arg, clear_load_arg): clean up also data tables as same as symbols tables. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@34867 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_marshal.rb | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'test') diff --git a/test/ruby/test_marshal.rb b/test/ruby/test_marshal.rb index 5ae521e4f6..d40c9da4d4 100644 --- a/test/ruby/test_marshal.rb +++ b/test/ruby/test_marshal.rb @@ -72,6 +72,34 @@ class TestMarshal < Test::Unit::TestCase assert_equal("marshal data too short", e.message) end + class DumpTest + def marshal_dump + loop { Thread.pass } + end + end + + class LoadTest + def marshal_dump + nil + end + def marshal_load(obj) + loop { Thread.pass } + end + end + + def test_context_switch + o = DumpTest.new + Thread.new { Marshal.dump(o) } + GC.start + assert(true, '[ruby-dev:39425]') + + o = LoadTest.new + m = Marshal.dump(o) + Thread.new { Marshal.load(m) } + GC.start + assert(true, '[ruby-dev:39425]') + end + def test_taint x = Object.new x.taint -- cgit v1.2.3