[MacRuby] #1313: #to_json will cause a stack overflow if generating a collection with objective-c objects

MacRuby ruby-noreply at macosforge.org
Fri Jun 3 17:19:49 PDT 2011


#1313: #to_json will cause a stack overflow if generating a collection with
objective-c objects
------------------------------------+---------------------------------------
 Reporter:  mrada@…                 |       Owner:  lsansonetti@…        
     Type:  defect                  |      Status:  new                  
 Priority:  critical                |   Milestone:                       
Component:  MacRuby                 |    Keywords:  reduction            
------------------------------------+---------------------------------------
 Reduction:

 {{{
 require 'json'
 [NSString.alloc.initWithString('')].to_json
 }}}

 It looks like the issue is caused because the JSON library does not match
 a type against an NSString, so it tries to generate JSON using the value
 of #to_s, which returns another NSString.

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



More information about the macruby-tickets mailing list