#736: Unpack inconsistencies (possibly related to issue #605?) ---------------------------------+------------------------------------------ Reporter: babs.devs@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: Component: MacRuby | Keywords: Grit, unpack ---------------------------------+------------------------------------------ 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 -- Ticket URL: <http://www.macruby.org/trac/ticket/736> MacRuby <http://macruby.org/>