Bugs item #26840, was opened at 2009-08-04 13:16
You can respond by visiting:
http://rubyforge.org/tracker/?func=detail&atid=575&aid=26840&group_id=126
Category: other
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Ryan Riley (panesofglass)
Assigned to: Nobody (None)
Summary: Computed hash in dependency.rb and specification.rb is sometimes too
large.
Initial Comment:
The current hash algorithm in dependency.rb (line 138) and specification.rb
(line 658) can sometimes create a hash that is too large. In particular, this
is causing problems in IronRuby gems, but this is also possible in MRI.
Suggested fixes are:
edit: c:/ruby/libs/ruby/site_ruby/1.8/rubygems/dependency.rb;C840659
File: dependency.rb
===================================================================
--- c:/ruby/libs/ruby/site_ruby/1.8/rubygems/dependency.rb;C840659 (server)
6/23/2009 1:21 PM
+++ c:/ruby/libs/ruby/site_ruby/1.8/rubygems/dependency.rb
@@ -112,7 +112,7 @@
end
def hash # :nodoc:
- name.hash + type.hash + version_requirements.hash
+ name.hash ^ type.hash ^ version_requirements.hash
end
end
===================================================================
edit: c:/ruby/libs/ruby/site_ruby/1.8/rubygems/specification.rb;C908357
File: specification.rb
===================================================================
--- c:/ruby/libs/ruby/site_ruby/1.8/rubygems/specification.rb;C908357 (server)
6/23/2009 1:24 PM
+++ c:/ruby/libs/ruby/site_ruby/1.8/rubygems/specification.rb
@@ -661,9 +661,8 @@
private :same_attributes?
def hash # :nodoc:
- @@attributes.inject(0) { |hash_code, (name, default_value)|
- n = self.send(name).hash
- hash_code + n
+ @@attributes.inject(612553) { |hash_code, (name, default_value)|
+ hash_code ^ self.send(name).hash
}
end
===================================================================
----------------------------------------------------------------------
You can respond by visiting:
http://rubyforge.org/tracker/?func=detail&atid=575&aid=26840&group_id=126
_______________________________________________
Rubygems-developers mailing list
http://rubyforge.org/projects/rubygems
[email protected]
http://rubyforge.org/mailman/listinfo/rubygems-developers