ruby-changes:44480
From: nobu <ko1@a...>
Date: Fri, 4 Nov 2016 10:51:23 +0900 (JST)
Subject: [ruby-changes:44480] nobu:r56553 (trunk): pathname.c: unnormalized Fixnum value
nobu 2016-11-04 10:51:18 +0900 (Fri, 04 Nov 2016) New Revision: 56553 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=56553 Log: pathname.c: unnormalized Fixnum value * ext/pathname/pathname.c (path_hash): fix unnormalized Fixnum value bug on mingw/mswin. Modified files: trunk/ChangeLog trunk/ext/pathname/pathname.c Index: ChangeLog =================================================================== --- ChangeLog (revision 56552) +++ ChangeLog (revision 56553) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Fri Nov 4 10:51:16 2016 Nobuyoshi Nakada <nobu@r...> + + * ext/pathname/pathname.c (path_hash): fix unnormalized Fixnum + value bug on mingw/mswin. + Fri Nov 4 10:35:47 2016 Nobuyoshi Nakada <nobu@r...> * lib/fileutils.rb (FileUtils::Entry_#copy): ensure that the Index: ext/pathname/pathname.c =================================================================== --- ext/pathname/pathname.c (revision 56552) +++ ext/pathname/pathname.c (revision 56553) @@ -155,11 +155,15 @@ path_cmp(VALUE self, VALUE other) https://github.com/ruby/ruby/blob/trunk/ext/pathname/pathname.c#L155 return INT2FIX(0); } +#ifndef ST2FIX +#define ST2FIX(h) LONG2FIX((long)(h)) +#endif + /* :nodoc: */ static VALUE path_hash(VALUE self) { - return INT2FIX(rb_str_hash(get_strpath(self))); + return ST2FIX(rb_str_hash(get_strpath(self))); } /* -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/