#769: String::ord with packed array in MacRuby
---------------------------------+------------------------------------------
 Reporter:  babs.d...@…          |       Owner:  lsansone...@…                  
                
     Type:  defect               |      Status:  new                            
                
 Priority:  blocker              |   Milestone:  MacRuby 0.7                    
                
Component:  MacRuby              |    Keywords:  binary, pack, ord, ordinal, 
String, String::ord
---------------------------------+------------------------------------------
 When attempting to get the ordinal from a character of an array packed to
 a binary string, MacRuby returns inconsistent values, and sometimes seg.
 faults.

 {{{
 sha1 = ["94f389bf5d9af4511597d035e69d1be9510b50c7"].pack("H*")
 sha1[0].ord
 #Macirb has returned:
 #  63, 96, 65428(most often), 65535, and seg. faults
 #Irb returns: 148

 foo = ['bar'].pack('H*')
 foo[1].ord
 #Macirb:65456 Irb:176

 "cat"[0].ord
 #Works as expected
 }}}

 Tested with Ruby 1.9.1 and Macruby 6/23/10 nightly.

-- 
Ticket URL: <http://www.macruby.org/trac/ticket/769>
MacRuby <http://macruby.org/>

_______________________________________________
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel

Reply via email to