From 1a935606b5e307375ce9d4215a46da2ca91dc1d6 Mon Sep 17 00:00:00 2001 From: Jeremy Evans Date: Fri, 24 Jul 2020 08:09:50 -0700 Subject: [rubygems/rubygems] Fix Kernel#warn override to handle backtrace location with nil path It's very unlikely to hit this case, but it is possible, as Thread::Backtrace::Location#path can return nil if the location is a cfunc with no previous iseq. See location_path in vm_backtrace.c in Ruby. https://github.com/rubygems/rubygems/commit/511935645a --- lib/rubygems/core_ext/kernel_warn.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'lib/rubygems') diff --git a/lib/rubygems/core_ext/kernel_warn.rb b/lib/rubygems/core_ext/kernel_warn.rb index e10a845b98..e030ef815c 100644 --- a/lib/rubygems/core_ext/kernel_warn.rb +++ b/lib/rubygems/core_ext/kernel_warn.rb @@ -38,10 +38,11 @@ if RUBY_VERSION >= "2.5" start += 1 - path = loc.path - unless path.start_with?(rubygems_path) or path.start_with?('