summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/bug-11928.rb14
-rw-r--r--test/ruby/test_exception.rb6
2 files changed, 20 insertions, 0 deletions
diff --git a/test/ruby/bug-11928.rb b/test/ruby/bug-11928.rb
new file mode 100644
index 0000000000..72b3b0f8ed
--- /dev/null
+++ b/test/ruby/bug-11928.rb
@@ -0,0 +1,14 @@
+class Segfault
+ at_exit { Segfault.new.segfault }
+
+ define_method 'segfault' do
+ n = 11928
+ v = nil
+ i = 0
+ while i < n
+ i += 1
+ v = (foo rescue $!).local_variables
+ end
+ assert_equal(%i[i n v], v.sort)
+ end
+end
diff --git a/test/ruby/test_exception.rb b/test/ruby/test_exception.rb
index 1148277a1b..91732dd062 100644
--- a/test/ruby/test_exception.rb
+++ b/test/ruby/test_exception.rb
@@ -701,6 +701,12 @@ end.join
assert_equal(%i[a b c d e f g], e.local_variables.sort)
end
+ def test_name_error_info_parent_iseq_mark
+ assert_separately(['-', File.join(__dir__, 'bug-11928.rb')], <<-'end;')
+ -> {require ARGV[0]}.call
+ end;
+ end
+
def test_output_string_encoding
# "\x82\xa0" in cp932 is "\u3042" (Japanese hiragana 'a')
# change $stderr to force calling rb_io_write() instead of fwrite()