Project

General

Profile

Bug #837

異クラスの例外同士の比較でSystemStackError

Added by wanabe (_ wanabe) over 11 years ago. Updated almost 9 years ago.

Status:
Closed
Priority:
Normal
Target version:
-
ruby -v:
Backport:
[ruby-dev:36796]

Description

=begin
ワナベと申します。

1.9 でクラスの異なる例外オブジェクトを比較すると
exc_equal で循環してしまい SystemStackError になってしまいます。

$ ruby -ve 'Exception.new == RuntimeError.new'
ruby 1.9.0 (2008-10-20 revision 19851) [i386-mingw32]
-e:1: warning: useless use of == in void context
-e:1:in ==': stack level too deep (SystemStackError)
from -e:1:in
=='
from -e:1:in =='
from -e:1:in
=='
from -e:1:in =='
from -e:1:in
=='
from -e:1:in =='
from -e:1:in
=='
from -e:1:in =='
... 6144 levels...
from -e:1:in
=='
from -e:1:in =='
from -e:1:in
=='
from -e:1:in `'

また、Exception.new == 1 や Exception.new == 1.0 などでも
SystemStackError になります。

--
ワナベ
=end

Also available in: Atom PDF