[ruby-core:78067] [Ruby trunk Bug#12915] 1..nil can be created by Marshal.load
From:
shugo@...
Date:
2016-11-10 03:24:04 UTC
List:
ruby-core #78067
Issue #12915 has been reported by Shugo Maeda.
----------------------------------------
Bug #12915: 1..nil can be created by Marshal.load
https://bugs.ruby-lang.org/issues/12915
* Author: Shugo Maeda
* Status: Assigned
* Priority: Normal
* Assignee: Yukihiro Matsumoto
* ruby -v:
* Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
1..nil can be created by Marshal.load as mame san stated on Twitter (https://twitter.com/mametter/status/796372577031622656):
```
lexington:ruby$ ./ruby -ve 'p 1..nil'
ruby 2.4.0dev (2016-11-10 trunk 56682) [x86_64-linux]
-e:1:in `<main>': bad value for range (ArgumentError)
lexington:ruby$ ./ruby -ve 'p Marshal.load("\x04\bo:\nRange\b:\texclF:\nbegini\x06:\bend0")'
ruby 2.4.0dev (2016-11-10 trunk 56682) [x86_64-linux]
1..nil
```
Is it intentional behavior (e.g., for compatibility with old versions of Ruby, where 1..nil is allowed)?
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>