summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAaron Patterson <tenderlove@ruby-lang.org>2022-12-02 09:44:10 -0600
committerAaron Patterson <aaron.patterson@gmail.com>2022-12-03 13:03:51 -0600
commitdba61f487cd7c1555f1187a2e2846506c1b143be (patch)
tree46920be506c2a4bac4c934974eb2aadb419f38ec /test
parentb8a73e704ddc77db36317dda293e99fb0ee641f4 (diff)
return early if there is no is_entries buffer
If there is a compilation error, is_entries may not be allocated, but ic_size could be greater than 0. If we don't have a buffer to iterate over, just return early. Otherwise GC could segv [Bug #19173]
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/6853
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_iseq.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_iseq.rb b/test/ruby/test_iseq.rb
index 2a18ff02e1..563aeeeaea 100644
--- a/test/ruby/test_iseq.rb
+++ b/test/ruby/test_iseq.rb
@@ -355,6 +355,13 @@ class TestISeq < Test::Unit::TestCase
end
end
+ # [Bug #19173]
+ def test_compile_error
+ assert_raise SyntaxError do
+ RubyVM::InstructionSequence.compile 'using Module.new; yield'
+ end
+ end
+
def test_compile_file_error
Tempfile.create(%w"test_iseq .rb") do |f|
f.puts "end"