Project

General

Profile

Actions

Bug #12915

closed

1..nil can be created by Marshal.load

Added by shugo (Shugo Maeda) about 8 years ago. Updated about 8 years ago.

Status:
Closed
Target version:
-
[ruby-core:78067]

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)?


Related issues 2 (0 open2 closed)

Related to Ruby master - Feature #12912: An endless range `(1..)`ClosedActions
Related to Ruby master - Bug #12918: (1/nil) can be created by Marshal.loadClosedActions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0