[ruby-cvs:70737] mame:r63646 (trunk): range.c: prohibit `(1..nil)`

mame at ruby-lang.org mame at ruby-lang.org
Wed Jun 13 18:04:32 JST 2018


mame	2018-06-13 18:04:32 +0900 (Wed, 13 Jun 2018)

  New Revision: 63646

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=63646

  Log:
    range.c: prohibit `(1..nil)`
    
    Now endless range can be created by either a literal `(1..)` or explicit
    range creation `Range.new(1, nil)`.  [Bug #14845]
    
    This change is intended for "early failure"; for example,
    `(1..var).to_a` causes out of memory if `var` is inadvertently nil.

  Modified files:
    trunk/compile.c
    trunk/parse.y
    trunk/range.c
    trunk/test/ruby/test_range.rb


More information about the ruby-cvs mailing list