Actions
Bug #14549
closedabort Date#step
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.6.0dev (2018-02-24 trunk 62563) [x86_64-darwin16]
Backport:
Description
require 'date'
o = Object.new
def o.<=>(*)
2
end
Date.new(2000, 1, 1).step(3, o) { }
#=> abort
I think, It's not intentional behavior.
And it should raise TypeError
or ArgumentError
, maybe.
Updated by nobu (Nobuyoshi Nakada) about 7 years ago
- Description updated (diff)
- Backport changed from 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN to 2.3: REQUIRED, 2.4: REQUIRED, 2.5: REQUIRED
Updated by nobu (Nobuyoshi Nakada) about 7 years ago
- Status changed from Open to Closed
Applied in changeset trunk|r62572.
date_core.c: defensive code
-
ext/date/date_core.c (f_cmp): check comparison failure.
-
ext/date/date_core.c (d_lite_step): deal with the comparison
result more defensively. [ruby-core:85796] [Bug #14549]
Updated by naruse (Yui NARUSE) about 7 years ago
- Backport changed from 2.3: REQUIRED, 2.4: REQUIRED, 2.5: REQUIRED to 2.3: REQUIRED, 2.4: REQUIRED, 2.5: DONE
ruby_2_5 r62610 merged revision(s) 62572.
Updated by nagachika (Tomoyuki Chikanaga) almost 7 years ago
- Backport changed from 2.3: REQUIRED, 2.4: REQUIRED, 2.5: DONE to 2.3: REQUIRED, 2.4: DONE, 2.5: DONE
ruby_2_4 r62883 merged revision(s) 62572.
Updated by usa (Usaku NAKAMURA) almost 7 years ago
- Backport changed from 2.3: REQUIRED, 2.4: DONE, 2.5: DONE to 2.3: DONE, 2.4: DONE, 2.5: DONE
ruby_2_3 r62947 merged revision(s) 62572.
Actions
Like0
Like0Like0Like0Like0Like0