summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlexander Momchilov <alexander.momchilov@shopify.com>2026-05-13 17:13:53 -0400
committerJeremy Evans <code@jeremyevans.net>2026-05-14 09:34:05 -0700
commita3a2d461aa8cbcc1cb4a7c859acfaa4cbd686e77 (patch)
treeb85c875ee5a3c98a1bffb232d9512206aca2adf3 /test
parent6a211f21e87252cec01b359a76793f686a5553f2 (diff)
[Bug #22070] Fix segfault in `Thread.each_caller_location`
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_backtrace.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ruby/test_backtrace.rb b/test/ruby/test_backtrace.rb
index dad7dfcb55..332d76c58e 100644
--- a/test/ruby/test_backtrace.rb
+++ b/test/ruby/test_backtrace.rb
@@ -191,6 +191,16 @@ class TestBacktrace < Test::Unit::TestCase
assert_equal(cl.map(&:to_s), ary.map(&:to_s))
end
+ def test_each_caller_location_single_cfunc_frame
+ assert_normal_exit <<~'RUBY'
+ tap { Thread.each_caller_location(1, 1) { |loc| loc.label } }
+ RUBY
+
+ cl = nil; ary = []
+ tap { cl = caller_locations(1, 1); Thread.each_caller_location(1, 1) { |x| ary << x } }
+ assert_equal(cl.map(&:to_s), ary.map(&:to_s))
+ end
+
def test_caller_locations_first_label
def self.label
caller_locations.first.label