Actions
Bug #12915
closed1..nil can be created by Marshal.load
Description
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)?
Updated by mame (Yusuke Endoh) about 8 years ago
- Related to Feature #12912: An endless range `(1..)` added
Updated by shugo (Shugo Maeda) about 8 years ago
- Related to Bug #12918: (1/nil) can be created by Marshal.load added
Updated by nobu (Nobuyoshi Nakada) about 8 years ago
- Status changed from Assigned to Closed
Applied in changeset r56703.
range.c: check loading
- range.c (range_loader): check loading values if the data came
from an initialized range object. [ruby-core:78067] [Bug #12915]
Actions
Like0
Like0Like0Like0