[前][次][番号順一覧][スレッド一覧]

ruby-changes:55260

From: nobu <ko1@a...>
Date: Mon, 8 Apr 2019 12:26:35 +0900 (JST)
Subject: [ruby-changes:55260] nobu:r67467 (trunk): range.c: force hash values fixable

nobu	2019-04-08 12:26:28 +0900 (Mon, 08 Apr 2019)

  New Revision: 67467

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=67467

  Log:
    range.c: force hash values fixable
    
    * range.c (method_hash): force hash values fixable on LLP64
      environment.  [ruby-core:92191] [Bug #15756]

  Modified files:
    trunk/proc.c
    trunk/test/ruby/test_method.rb
Index: proc.c
===================================================================
--- proc.c	(revision 67466)
+++ proc.c	(revision 67467)
@@ -1557,7 +1557,7 @@ method_hash(VALUE method) https://github.com/ruby/ruby/blob/trunk/proc.c#L1557
     hash = rb_hash_method_entry(hash, m->me);
     hash = rb_hash_end(hash);
 
-    return INT2FIX(hash);
+    return ST2FIX(hash);
 }
 
 /*
Index: test/ruby/test_method.rb
===================================================================
--- test/ruby/test_method.rb	(revision 67466)
+++ test/ruby/test_method.rb	(revision 67467)
@@ -197,6 +197,7 @@ class TestMethod < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_method.rb#L197
     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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]