zlib.c: fix unnormalized Fixnum

* ext/zlib/zlib.c (rb_gzfile_total_out): cast to long not to
  result in an unsigned long to normalized to Fixnum on LLP64
  platforms.  [ruby-core:81488]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59337 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2017-07-14 13:50:00 +00:00
parent 57464618ab
commit 5d6c1f42d5

View File

@ -3399,7 +3399,7 @@ rb_gzfile_total_out(VALUE obj)
if (total_out >= (uLong)buf_filled) { if (total_out >= (uLong)buf_filled) {
return rb_uint2inum(total_out - buf_filled); return rb_uint2inum(total_out - buf_filled);
} else { } else {
return LONG2FIX(-(buf_filled - total_out)); return LONG2FIX(-(buf_filled - (long)total_out));
} }
} }