diff options
author | Aaron Patterson <tenderlove@ruby-lang.org> | 2022-12-02 09:44:10 -0600 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2022-12-03 13:03:51 -0600 |
commit | dba61f487cd7c1555f1187a2e2846506c1b143be (patch) | |
tree | 46920be506c2a4bac4c934974eb2aadb419f38ec /test/ruby | |
parent | b8a73e704ddc77db36317dda293e99fb0ee641f4 (diff) | |
download | ruby-dba61f487cd7c1555f1187a2e2846506c1b143be.tar.gz |
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]
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_iseq.rb | 7 |
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" |