Ticket #737 (closed defect: duplicate)
Unpack inconsistencies (possibly related to issue #605?)
| Reported by: | babs.devs@… | Owned by: | lsansonetti@… |
|---|---|---|---|
| Priority: | major | Milestone: | MacRuby 0.8 |
| Component: | MacRuby | Keywords: | Grit, unpack |
| Cc: |
Description
I am attempting to use the Grit( http://github.com/mojombo/grit) gem (after various patches to work w/ macruby), but there seems to be some inconsistency between unpacking strings w ruby 1.9 and MacRuby (nightly as of 6/3/10).
Specifically with this method:
def init_pack
with_idx do |idx|
@offsets = [0]
FanOutCount.times do |i|
//MacRuby vs Ruby assign VERY different values to pos
pos = idx[i * IdxOffsetSize,IdxOffsetSize].unpack('N')[0]
if pos < @offsets[i]
raise PackFormatError, "pack #@name has discontinuous index #{i}"
end
@offsets << pos
end
@size = @offsets[-1]
end
end
In MacRuby the var 'pos' evaluates to [0, 4285812579] in every other block.
In Ruby 1.9 'pos' evaluates correctly (ex. after 7 blocks: [0, 11, 24, 39, 48, 56, 63])
This bug may be invalid, and/or related to the Grit gem, but at first glance appears to be MacRuby related.
@see also: http://www.macruby.org/trac/ticket/605
Attachments
Change History
Note: See
TracTickets for help on using
tickets.


