Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Array#pack difference between jruby 1.7.10 and ruby 1.9.3 #1478

Closed
dmendel opened this Issue · 2 comments

4 participants

@dmendel
$ ruby --version
ruby 1.9.3p448 (2013-06-27 revision 41675) [x86_64-linux]

$ ruby -e 'p [0xfffffffffffffffff].pack("C")' 
"\xFF"
$ ruby --version                                   
jruby 1.7.10 (1.9.3p392) 2014-01-09 c4ecd6b on OpenJDK 64-Bit Server VM 1.7.0_51-b00 [linux-amd64]

$ ruby -e 'p [0xfffffffffffffffff].pack("C")'
RangeError: bignum too big to convert into `long'
    pack at org/jruby/RubyArray.java:4129
  (root) at -e:1
@lucasallan
Collaborator

I'll take a look on it. Thanks @dmendel

@lucasallan lucasallan referenced this issue from a commit in lucasallan/jruby
@lucasallan lucasallan Fixing Issue #1478 - Related to Array#pack. a26418f
@lucasallan lucasallan referenced this issue from a commit in lucasallan/jruby
@lucasallan lucasallan Fixing Issue #1478 - Related to Array#pack. 65176f4
@lucasallan lucasallan referenced this issue from a commit in lucasallan/jruby
@lucasallan lucasallan Fixing Issue #1478 - Related to Array#pack. c86709e
@DavidEGrayson

I encountered this issue today in JRuby 1.7.11.

It is interesting compared to other JRuby bugs because it can be reproduced with so few characters:

[1<<99].pack ?C
@atambo atambo closed this in 10638d1
@enebo enebo added this to the JRuby 1.7.12 milestone
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.