diff options
| author | Alexander Momchilov <alexander.momchilov@shopify.com> | 2026-05-13 17:13:53 -0400 |
|---|---|---|
| committer | Jeremy Evans <code@jeremyevans.net> | 2026-05-14 09:34:05 -0700 |
| commit | a3a2d461aa8cbcc1cb4a7c859acfaa4cbd686e77 (patch) | |
| tree | b85c875ee5a3c98a1bffb232d9512206aca2adf3 /test | |
| parent | 6a211f21e87252cec01b359a76793f686a5553f2 (diff) | |
[Bug #22070] Fix segfault in `Thread.each_caller_location`
Diffstat (limited to 'test')
| -rw-r--r-- | test/ruby/test_backtrace.rb | 10 |
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 |
