Project

General

Profile

Actions

Bug #14549

closed

abort Date#step

Added by ksss (Yuki Kurihara) about 6 years ago. Updated about 6 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.6.0dev (2018-02-24 trunk 62563) [x86_64-darwin16]
[ruby-core:85796]

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.

Actions #1

Updated by nobu (Nobuyoshi Nakada) about 6 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
Actions #2

Updated by nobu (Nobuyoshi Nakada) about 6 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 6 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.

Actions #4

Updated by nagachika (Tomoyuki Chikanaga) about 6 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) about 6 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

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0