Project

General

Profile

Actions

Bug #7575

closed

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

Added by tadf (tadayoshi funaba) over 11 years ago. Updated over 11 years ago.

Status:
Closed
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 method b' for #<struct Struct::Foo a=1, :"b\x00"=2> (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 1 (0 open1 closed)

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

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0