Project

General

Profile

Bug #837

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

Added by wanabe (_ wanabe) over 10 years ago. Updated about 8 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

History

#1

Updated by usa (Usaku NAKAMURA) over 10 years ago

  • Assignee set to ko1 (Koichi Sasada)

=begin

=end

#2

Updated by matz (Yukihiro Matsumoto) over 10 years ago

  • Status changed from Open to Closed

=begin
fixed by r19856.
=end

Also available in: Atom PDF