aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-06-19 14:36:17 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-06-19 14:36:17 +0000
commit828a51f20ebcc7d4e1db0e0dbfe80aa4c56fa71e (patch)
tree99b4e29261e713ca83ac5eafa8cdb0b49342f31c /test
parentfaea2f17389ce24386d51abfe1b50e1212829ad5 (diff)
downloadruby-828a51f20ebcc7d4e1db0e0dbfe80aa4c56fa71e.tar.gz
test for [Bug #12670]
heap corruption by deferred free. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59116 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/-ext-/typeddata/test_typeddata.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/-ext-/typeddata/test_typeddata.rb b/test/-ext-/typeddata/test_typeddata.rb
index daeda7611a..a8a7c965c9 100644
--- a/test/-ext-/typeddata/test_typeddata.rb
+++ b/test/-ext-/typeddata/test_typeddata.rb
@@ -17,4 +17,15 @@ class Test_TypedData < Test::Unit::TestCase
obj = eval("class C\u{1f5ff}; self; end").new
assert_raise_with_message(TypeError, /C\u{1f5ff}/) {Bug::TypedData.check(obj)}
end
+
+ def test_deferred_free
+ assert_ruby_status([], "#{<<-"begin;"}\n#{<<-"end;"}")
+ require "-test-/typeddata"
+ begin;
+ n = 1 << 20
+ Bug::TypedData.make(n)
+ end;
+ rescue MiniTest::Assertion => e
+ skip e.message
+ end
end