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

MacRuby ruby-noreply at macosforge.org
Tue Jun 7 10:22:43 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            
------------------------------------+---------------------------------------

Comment(by mrada@…):

 It seems that all core types are not handled properly by the generate_json
 function. Other objective-c types return an NSString when #to_s is called.

 However, simply changing generate_json to call String() instead of #to_s,
 or even just handling NSString, will only fix crashing. The generator will
 still not generate the correct JSON for objective-c core types.

 This is a fairly major regression in the library and I think it should be
 a 0.11 blocker.

 {{{
 framework 'Cocoa'
 [NSDictionary.alloc.initWithObjectsAndKeys(1,2,nil)].to_json
 }}}

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



More information about the macruby-tickets mailing list