Project

General

Profile

Actions

Bug #2583

closed

クラス定義中の defined? yield が "yield" を返す

Added by wanabe (_ wanabe) almost 15 years ago. Updated over 13 years ago.

Status:
Closed
Target version:
ruby -v:
ruby 1.9.2dev (2010-01-09 trunk 26260) [i386-mingw32]
Backport:
[ruby-dev:40009]

Description

=begin
クラス定義中は yield を呼べないにも関わらず、defined?(yield) が "yield" を返します。

$ ruby -ve 'class Foo;p defined?(yield);end'
ruby 1.9.2dev (2010-01-09 trunk 26260) [i386-mingw32]
"yield"

GET_BLOCK_PTR() はクラス定義中なら 0 を返す方がいいと思うのですがどうでしょうか。
パッチを添付します。なお、このパッチで Bug #2568 も修正されます。
=end


Files

check_block.patch (485 Bytes) check_block.patch wanabe (_ wanabe), 01/10/2010 05:36 AM

Related issues 2 (0 open2 closed)

Related to Backport191 - Backport #2568: Segmentation fault deleting key named :class via Hash#delete defined via define_methodClosedyugui (Yuki Sonoda)Actions
Has duplicate Ruby master - Bug #2584: クラス定義中の defined? yield が "yield" を返すRejectedko1 (Koichi Sasada)01/10/2010Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0