Project

General

Profile

Bug #7575

Struct のメンバーをアクセサで参照できない事がある

Added by tadf (tadayoshi funaba) almost 8 years ago. Updated almost 8 years ago.

Status:
Closed
Priority:
Normal
Target version:
ruby -v:
ruby 2.0.0dev (2012-12-16 trunk 38415) [i686-linux]
Backport:
[ruby-dev:46750]

Description

Struct のメンバーをアクセサで参照できない事がある。

$ ruby -v -e 'Foo = Struct.new("Foo", "a", "b\000"); foo = Foo.new(1,2); p foo.send("a"); p foo.send("b\000")'
ruby 2.0.0dev (2012-12-16 trunk 38415) [i686-linux]
1
-e:1:in <main>': undefined methodb' for # (NoMethodError)

$ ruby -v -r ostruct -e 'foo = OpenStruct.new("a"=>1, "b\000"=>2); p foo.send("a"); p foo.send("b\000")'
ruby 2.0.0dev (2012-12-16 trunk 38415) [i686-linux]
1
2


Files

patch.diff (1.35 KB) patch.diff Glass_saga (Masaki Matsushita), 12/20/2012 10:33 PM

Related issues

Related to Ruby master - Bug #8756: SEGFAULT caused by `p Struct.new(:q?).instance_methods`ClosedGlass_saga (Masaki Matsushita)08/09/2013Actions

Also available in: Atom PDF