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

ruby-changes:32455

From: usa <ko1@a...>
Date: Thu, 9 Jan 2014 17:42:49 +0900 (JST)
Subject: [ruby-changes:32455] usa:r44534 (trunk): * hash.c (rb_any_hash): should treat the return value of rb_objid_hash()

usa	2014-01-09 17:42:42 +0900 (Thu, 09 Jan 2014)

  New Revision: 44534

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=44534

  Log:
    * hash.c (rb_any_hash): should treat the return value of rb_objid_hash()
      as `long', because ruby assumes the object id of an object is `long'.
      this fixes test failures on mswin64 introduced at r44525.

  Modified files:
    trunk/ChangeLog
    trunk/hash.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 44533)
+++ ChangeLog	(revision 44534)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Thu Jan  9 17:40:28 2014  NAKAMURA Usaku  <usa@r...>
+
+	* hash.c (rb_any_hash): should treat the return value of rb_objid_hash()
+	  as `long', because ruby assumes the object id of an object is `long'.
+	  this fixes test failures on mswin64 introduced at r44525.
+
 Thu Jan  9 09:55:20 2014  Aaron Patterson <aaron@t...>
 
 	* ext/psych/lib/psych/visitors/yaml_tree.rb: dumping strings with
Index: hash.c
===================================================================
--- hash.c	(revision 44533)
+++ hash.c	(revision 44534)
@@ -132,7 +132,8 @@ rb_any_hash(VALUE a) https://github.com/ruby/ruby/blob/trunk/hash.c#L132
 
     if (SPECIAL_CONST_P(a)) {
 	if (a == Qundef) return 0;
-	hnum = rb_objid_hash((st_index_t)a);
+	/* assume hnum is long, so need to drop upper dword on LLP64. */
+	hnum = (long)rb_objid_hash((st_index_t)a);
     }
     else if (BUILTIN_TYPE(a) == T_STRING) {
 	hnum = rb_str_hash(a);

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

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