#249: Attempting to modify instances of NSString or NSArray causes crash
---------------------------------+------------------------------------------
 Reporter:  jes...@…             |       Owner:  lsansone...@…        
     Type:  defect               |      Status:  new                  
 Priority:  blocker              |   Milestone:                       
Component:  MacRuby              |    Keywords:                       
---------------------------------+------------------------------------------

Comment(by lsansone...@…):

 Thanks for the report, this is likely a bug in the YARV #<< optimization.
 We do check for mutability before doing any destructive operations.

 {{{
 $ macruby -e 's=NSString.string; s.strip!'
 -e:1:in `strip!': can't modify immutable string (RuntimeError)
         from -e:1:in `<main>'
 }}}

 Also, I noticed that the check doesn't work for NSArray in 64-bit.

 {{{
 $ arch -i386 macruby -e "a = NSArray.array; a.clear"
 -e:1:in `clear': can't modify frozen/immutable array (RuntimeError)
         from -e:1:in `<main>'
 $ arch -x86_64 macruby -e "a = NSArray.array; a.clear"
 }}}

-- 
Ticket URL: <http://www.macruby.org/trac/ticket/249#comment:2>
MacRuby <http://macruby.org/>

_______________________________________________
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel

Reply via email to