summaryrefslogtreecommitdiff
path: root/test/ruby/test_marshal.rb
diff options
context:
space:
mode:
authorJean byroot Boussier <jean.boussier+github@shopify.com>2021-09-30 16:50:31 +0200
committerGitHub <noreply@github.com>2021-09-30 16:50:31 +0200
commit529fc204af84f825f98f83c34b004acbaa802615 (patch)
tree8e22edba83c8d5046e15dc5b97b89785444be52a /test/ruby/test_marshal.rb
parent912a8dcfc5369d840dcd6bf0f88ee0bac7d902d6 (diff)
downloadruby-529fc204af84f825f98f83c34b004acbaa802615.tar.gz
marshal.c: don't call the proc with partially initialized objects. (#4866)
For cyclic objects, it requires to keep a st_table of the partially initialized objects.
Diffstat (limited to 'test/ruby/test_marshal.rb')
-rw-r--r--test/ruby/test_marshal.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_marshal.rb b/test/ruby/test_marshal.rb
index f7f273af42..131ebd5fa6 100644
--- a/test/ruby/test_marshal.rb
+++ b/test/ruby/test_marshal.rb
@@ -858,4 +858,16 @@ class TestMarshal < Test::Unit::TestCase
assert_nil(e2.backtrace_locations) # temporal
end
end
+
+ class TestMarshalFreezeProc < Test::Unit::TestCase
+ include MarshalTestLib
+
+ def encode(o)
+ Marshal.dump(o)
+ end
+
+ def decode(s)
+ Marshal.load(s, :freeze.to_proc)
+ end
+ end
end