Issue #7575 has been updated by Glass_saga (Masaki Matsushita).


茯帥?鴻??帥?障???????????"b\000"???intern?????????ID_JUNK???ID????c?????障????冴???make_struct()???"b\000"??絲上?????????<?純????????絎?臂?????????????????с?????
"b\000"????is_identchar()??с??????絖???????障????????????с??intern?????????junk??с????????ゅ??????????障?????
緇???c???intern?????????junk???ID?????????????????????<?潟??????????荐宴????????????????????????????????????障?????

??<??帥??define_method??с???junk??????????<?純?????????臂??荐宴?????????????????с?????

class Foo
  define_method("foo@") { p 1 }
  define_method("foo\000") { p 2 }
end

f = Foo.new
f.send("foo@") #=> 1
f.send("foo\000") #=> 2
----------------------------------------
Bug #7575: Struct ???<?潟????若????≪??祉?泣?у????с?с??????篋??????????
https://bugs.ruby-lang.org/issues/7575#change-34816

Author: tadf (tadayoshi funaba)
Status: Open
Priority: Low
Assignee: 
Category: core
Target version: 2.0.0
ruby -v: ruby 2.0.0dev (2012-12-16 trunk 38415) [i686-linux]


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



-- 
http://bugs.ruby-lang.org/