Bug #3854: Adress to str[str.size] is now valid?
http://redmine.ruby-lang.org/issues/show/3854

Author: Victor Maslov
Status: Open, Priority: Normal
Target version: 1.9.2
ruby -v: ruby 1.9.2p0 (2010-08-18) [i386-mingw32]

C:\Users\Naki>irb
irb(main):001:0> s = ''; 10.times { s[s.size]='-' }; s
=> "----------"
irb(main):002:0> RUBY_DESCRIPTION
=> "ruby 1.9.2p0 (2010-08-18) [i386-mingw32]"

C:\Documents and Settings\_Oo>irb
irb(main):001:0> s = ''; 10.times { s[s.size]='-' }; s
IndexError: index 0 out of string
        from (irb):1:in `[]='
        from (irb):1
        from (irb):1:in `times'
        from (irb):1
irb(main):002:0> RUBY_VERSION
=> "1.8.6"
irb(main):003:0> RUBY_PATCHLEVEL
=> 287


----------------------------------------
http://redmine.ruby-lang.org