[MacRuby] #1068: Garbled data with long long <> Bignum conversions
#1068: Garbled data with long long <> Bignum conversions ---------------------------------+------------------------------------------ Reporter: dev@… | Owner: lsansonetti@… Type: defect | Status: new Priority: critical | Milestone: MacRuby 1.0 Component: MacRuby | Keywords: ---------------------------------+------------------------------------------ {{{ #!/usr/bin/env macruby n = 0x8C2CACEFCD8BBABA m = NSNumber.numberWithUnsignedLongLong n puts "%016X" % n puts "%016X" % m puts "%016X" % m.unsignedLongLongValue }}} Gives: {{{ 8C2CACEFCD8BBABA 0C2CACEFCD8BBABA 0C2CACEFCD8BBABA }}} I believe both signed and unsigned long longs are affected. The damage is always in the last (highest) byte. Some numbers (with a non-zero value in the 8th byte) still convert fine. Mailing list thread: http://lists.macosforge.org/pipermail/macruby- devel/2010-December/006637.html -- Ticket URL: <http://www.macruby.org/trac/ticket/1068> MacRuby <http://macruby.org/>
#1068: Garbled data with long long <> Bignum conversions ---------------------------------+------------------------------------------ Reporter: dev@… | Owner: lsansonetti@… Type: defect | Status: new Priority: critical | Milestone: MacRuby 1.0 Component: MacRuby | Keywords: ---------------------------------+------------------------------------------ Comment(by lsansonetti@…): The problem seems to be in the string formatting code, but in the long long conversion. Using Kernel#p on the NSNumber object returns 10100638210230827706 which is 8C2CACEFCD8BBABA in hex. -- Ticket URL: <http://www.macruby.org/trac/ticket/1068#comment:1> MacRuby <http://macruby.org/>
#1068: Garbled data with long long <> Bignum conversions ---------------------------------+------------------------------------------ Reporter: dev@… | Owner: lsansonetti@… Type: defect | Status: new Priority: critical | Milestone: MacRuby 1.0 Component: MacRuby | Keywords: ---------------------------------+------------------------------------------ Comment(by lsansonetti@…): Never mind, I printed the wrong object. -- Ticket URL: <http://www.macruby.org/trac/ticket/1068#comment:2> MacRuby <http://macruby.org/>
#1068: Garbled data with long long <> Bignum conversions ---------------------------------+------------------------------------------ Reporter: dev@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: critical | Milestone: MacRuby 1.0 Component: MacRuby | Resolution: fixed Keywords: | ---------------------------------+------------------------------------------ Changes (by lsansonetti@…): * status: new => closed * resolution: => fixed Comment: https://github.com/MacRuby/MacRuby/commit/01965bcc12a5a034c0f7e3979e878dc9f5... -- Ticket URL: <http://www.macruby.org/trac/ticket/1068#comment:3> MacRuby <http://macruby.org/>
#1068: Garbled data with long long <> Bignum conversions ---------------------------------+------------------------------------------ Reporter: dev@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: critical | Milestone: MacRuby 0.11 Component: MacRuby | Resolution: fixed Keywords: | ---------------------------------+------------------------------------------ Changes (by lsansonetti@…): * milestone: MacRuby 1.0 => MacRuby 0.11 -- Ticket URL: <http://www.macruby.org/trac/ticket/1068#comment:4> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby