Bug: unpack+pack with Bignum/Fixnum conflict (ruby 1.8.1)

K

Kero

Hi,

Receiving a binary 32-bits unsigned integer over a socket, I unpack it,
and later on pack to send back.

This works fine with ruby 1.8.0, but I got a RangeError stating the Bignum
is too big to be converted to `int'. We're talking high values here, the
one I saw where it went wrong was above 3 billion.

I would suggest adding a couple of checks to the testsuite:
- [MAXINT].pack("i") => should work
- [MAXINT+1].pack("i") => RangeError
and the same for unsigned flavours, shorts, longs, chars.

Bye,
Kero.

+--- Kero ----------------------- kero@chello@nl ---+
| all the meaningless and empty words I spoke |
| Promises -- The Cranberries |
+--- M38c --- http://httpd.chello.nl/k.vangelder ---+
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top