summaryrefslogtreecommitdiff
path: root/test/ruby/test_iseq.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-02-28 23:31:42 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-02-28 23:31:42 +0000
commit43e41029bf3594353513375d76ba15ded19b0a63 (patch)
treee2c8a4fc074ea26e1d2f2318287fe6d3257d9013 /test/ruby/test_iseq.rb
parent9af2ab9d89acb693236e9da58a482551e640e780 (diff)
Revert r61936 "compile.c: use ALLOCV_N"
* compile.c (ibf_dump_object_list): `dump->obj_list` is not fixed yet, as new objects are pushed by lbf_dump_object_object. fixes crash by buffer overflow. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62615 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_iseq.rb')
-rw-r--r--test/ruby/test_iseq.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_iseq.rb b/test/ruby/test_iseq.rb
index 6e81c63915..4c811611ba 100644
--- a/test/ruby/test_iseq.rb
+++ b/test/ruby/test_iseq.rb
@@ -395,4 +395,13 @@ class TestISeq < Test::Unit::TestCase
end
}
end
+
+ def test_to_binary_with_objects
+ code = "[]"+100.times.map{|i|"<</#{i}/"}.join
+ bin = assert_nothing_raised {
+ RubyVM::InstructionSequence.compile(code).to_binary
+ }
+ # load_from_binary doesn't work now
+ assert_instance_of(String, bin)
+ end
end