From 627b2e2d56db1daffa76a98c215b3d4a7c64c027 Mon Sep 17 00:00:00 2001 From: Samuel Giddins Date: Thu, 27 Sep 2018 09:20:58 -0700 Subject: Only check for infinite loop on #missing_extensions? --- lib/bundler/stub_specification.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/bundler/stub_specification.rb b/lib/bundler/stub_specification.rb index deaa7905c9..2333a4318a 100644 --- a/lib/bundler/stub_specification.rb +++ b/lib/bundler/stub_specification.rb @@ -36,7 +36,7 @@ module Bundler # This is defined directly to avoid having to load every installed spec def missing_extensions? - stub.missing_extensions? + stub(true).missing_extensions? end def activated @@ -82,8 +82,8 @@ module Bundler # from `Gem.loaded_specs`, which can end up being self. # #_remote_specification has logic to handle this case, so delegate to that in that situation, # because otherwise we can end up with a stack overflow when calling #missing_extensions? - def stub - if @_remote_specification.nil? && @stub.instance_variable_get(:@data) && Gem.loaded_specs[name].equal?(self) + def stub(check = false) + if check && @_remote_specification.nil? && @stub.instance_variable_get(:@data) && Gem.loaded_specs[name].equal?(self) _remote_specification end @stub @@ -95,7 +95,7 @@ module Bundler @_remote_specification ||= begin rs = @stub.to_spec if rs.equal?(self) # happens when to_spec gets the spec from Gem.loaded_specs - rs = Gem::Specification.load(@stub.loaded_from) + rs = Bundler.load_gemspec(@stub.loaded_from) Bundler.rubygems.stub_set_spec(@stub, rs) end -- cgit v1.2.1