ruby: FIXNUM_P(self) may be false in Fixnum on JRuby

This commit is contained in:
FURUHASHI Sadayuki 2011-05-09 22:06:12 +09:00
parent f50694cc96
commit bbaf8c2f67

View File

@ -114,7 +114,7 @@ static VALUE MessagePack_Fixnum_to_msgpack(int argc, VALUE *argv, VALUE self)
{
ARG_BUFFER(out, argc, argv);
#ifdef JRUBY
msgpack_pack_long(out, rb_num2long(self));
msgpack_pack_long(out, FIXNUM_P(self) ? FIX2LONG(self) : rb_num2ll(self));
#else
msgpack_pack_long(out, FIX2LONG(self));
#endif