summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--proc.c2
-rw-r--r--test/ruby/test_method.rb1
2 files changed, 2 insertions, 1 deletions
diff --git a/proc.c b/proc.c
index e63b8469ac7..558304fb7f4 100644
--- a/proc.c
+++ b/proc.c
@@ -1557,7 +1557,7 @@ method_hash(VALUE method)
hash = rb_hash_method_entry(hash, m->me);
hash = rb_hash_end(hash);
- return INT2FIX(hash);
+ return ST2FIX(hash);
}
/*
diff --git a/test/ruby/test_method.rb b/test/ruby/test_method.rb
index f313279f624..beffaa8ce03 100644
--- a/test/ruby/test_method.rb
+++ b/test/ruby/test_method.rb
@@ -197,6 +197,7 @@ class TestMethod < Test::Unit::TestCase
def o.foo; end
assert_kind_of(Integer, o.method(:foo).hash)
assert_equal(Array.instance_method(:map).hash, Array.instance_method(:collect).hash)
+ assert_kind_of(String, o.method(:foo).hash.to_s)
end
def test_owner