[MacRuby] #792: Hash#delete is broken.
#792: Hash#delete is broken. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ----------------------------------+----------------------------------------- Test Script: {{{ $ cat test_hash.rb h = { 1 => 'one', 2 => 'two', 3 => 'three', self => 'self', true => 'true', nil => 'nil', 'nil' => nil } h.each do |k, v| p "#{k} : #{v}" p h.delete(k) end p "Result: #{h}" }}} Result of Ruby 1.9.1: {{{ $ ruby test_hash.rb "1 : one" "one" "2 : two" "two" "3 : three" "three" "main : self" "self" "true : true" "true" " : nil" "nil" "nil : " nil "Result: {}" }}} Result of MacRuby Trunk: {{{ $ macruby test_hash.rb "1 : one" "one" "false : false" nil "Result: {2=>\"two\", 3=>\"three\", main=>\"self\", true=>\"true\", nil=>\"nil\", \"nil\"=>nil}" }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/792> MacRuby <http://macruby.org/>
#792: Hash#delete while iterating is broken. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ----------------------------------+----------------------------------------- Comment(by lsansonetti@…): The problem seems to appear when deleting pairs while iterating. Renamed the bug accordingly. -- Ticket URL: <http://www.macruby.org/trac/ticket/792#comment:1> MacRuby <http://macruby.org/>
#792: Hash#delete while iterating is broken. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: blocker | Milestone: Component: MacRuby | Resolution: wontfix Keywords: | ----------------------------------+----------------------------------------- Changes (by lsansonetti@…): * status: new => closed * resolution: => wontfix Comment: Modifying a container object during its iteration produces undefined results in MacRuby. It looks like there is no consensus on standard behavior on this issue and Matz confirmed that this is undefined behavior in http://groups.google.com/group/ruby-core- google/browse_thread/thread/c1800975272cbfdc/abe9796fbeddd33a?lnk=gst&q=undefined+behaviour&pli=1. Closing as wontfix. -- Ticket URL: <http://www.macruby.org/trac/ticket/792#comment:2> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby