range.c: prohibit (1..nil)
(1..nil)
Now endless range can be created by either a literal (1..) or explicit range creation Range.new(1, nil). [Bug #14845]
(1..)
Range.new(1, nil)
This change is intended for "early failure"; for example, (1..var).to_a causes out of memory if var is inadvertently nil.
(1..var).to_a
var
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
range.c: prohibit
(1..nil)
Now endless range can be created by either a literal
(1..)
or explicitrange creation
Range.new(1, nil)
. [Bug #14845]This change is intended for "early failure"; for example,
(1..var).to_a
causes out of memory ifvar
is inadvertently nil.git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e