class Bootsnap::LoadPathCache::Store

def load_data

def load_data
  @data = begin
    data = File.open(@store_path, encoding: Encoding::BINARY) do |io|
      MessagePack.load(io, freeze: true)
    end
    if data.is_a?(Hash) && data[VERSION_KEY] == CURRENT_VERSION
      data
    else
      default_data
    end
  # handle malformed data due to upgrade incompatibility
  rescue Errno::ENOENT, MessagePack::MalformedFormatError, MessagePack::UnknownExtTypeError, EOFError
    default_data
  rescue ArgumentError => error
    if error.message =~ /negative array size/
      default_data
    else
      raise
    end
  end
end