Issue #7870 has been updated by drbrain (Eric Hodel).

Assignee set to nobu (Nobuyoshi Nakada)

r38044 is the culprit.

Previously Ruby would return nil if the other object did not have to_str, now ruby calls other <=> self when other is not a String and does not have <=> leading to the infinite loop.
----------------------------------------
Bug #7870: Time.now == "" causes an infinite loop
https://bugs.ruby-lang.org/issues/7870#change-36350

Author: drbrain (Eric Hodel)
Status: Open
Priority: Urgent
Assignee: nobu (Nobuyoshi Nakada)
Category: core
Target version: 2.0.0
ruby -v: ruby 2.0.0dev (2013-02-08) [x86_64-darwin12.2.1]


=begin
This is a regression from 1.9.

2.0.0 branch:

  $ ./ruby20 -v ../branches/ruby_2_0_0/test.rb
  ruby 2.0.0dev (2013-02-08) [x86_64-darwin12.2.1]
  ../branches/ruby_2_0_0/test.rb:1: warning: possibly useless use of == in void context
  ../branches/ruby_2_0_0/test.rb:1: stack level too deep (SystemStackError)

1.9:

  $ ruby19 -v test.rb 
  ruby 1.9.3p374 (2013-01-15 revision 38858) [x86_64-darwin12.2.1]
  test.rb:1: warning: possibly useless use of == in void context

This also reproduces in trunk.

=end



-- 
http://bugs.ruby-lang.org/