diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-02-17 08:41:57 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-02-17 08:41:57 +0000 |
commit | dd998dd561c75054679f69b7e9d30af4bae7cfaa (patch) | |
tree | 45788a8865b567ce720366a01408fa74abbf89ef /test | |
parent | 8ae07cf34b3f8b428a46efa89b31bc3795b451d6 (diff) | |
download | ruby-dd998dd561c75054679f69b7e9d30af4bae7cfaa.tar.gz |
marshal.c: do not recycle wrapper objects
* marshal.c (marshal_dump, marshal_load): do not recycle wrapper
objects, to prevent from segfault with continuation.
[ruby-dev:47970] [Bug #9523]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45025 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_marshal.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/ruby/test_marshal.rb b/test/ruby/test_marshal.rb index d0ae231d87..1bbc999258 100644 --- a/test/ruby/test_marshal.rb +++ b/test/ruby/test_marshal.rb @@ -611,4 +611,23 @@ class TestMarshal < Test::Unit::TestCase end assert_empty(tainted.map {|x| [x, x.class]}, bug8945) end + + class Bug9523 + attr_reader :cc + def marshal_dump + callcc {|c| @cc = c } + nil + end + def marshal_load(v) + end + end + + def test_continuation + require "continuation" + c = Bug9523.new + assert_raise_with_message(RuntimeError, /Marshal\.dump reentered at marshal_dump/) do + Marshal.dump(c) + c.cc.call + end + end end |