[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
This commit is contained in:
parent
331fe6a88f
commit
1a935606b5
Notes:
git
2020-07-31 21:08:23 +09:00
@ -38,12 +38,13 @@ if RUBY_VERSION >= "2.5"
|
||||
|
||||
start += 1
|
||||
|
||||
path = loc.path
|
||||
if path = loc.path
|
||||
unless path.start_with?(rubygems_path) or path.start_with?('<internal:')
|
||||
# Non-rubygems frames
|
||||
uplevel -= 1
|
||||
end
|
||||
end
|
||||
end
|
||||
uplevel = start
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user