From: Yusuke ENDOH Date: 2007-06-29T22:26:52+09:00 Subject: [ruby-dev:31095] @0..0 dumps core 遠藤と申します。 1.8.6 、1.9 共に以下のようにすると落ちます。 $ ./ruby -e '@0..0' -e:1: `@0' is not allowed as an instance variable name -e:1: identifier @0 is not valid -e:1: [BUG] Segmentation fault ruby 1.8.6 (2007-06-29) [i686-linux] アボートしました (core dumped) 以下のパッチで落ちなくなりました。 Index: parse.y =================================================================== --- parse.y (revision 12667) +++ parse.y (working copy) @@ -4351,6 +4351,7 @@ else { rb_compile_error("`@@%c' is not allowed as a class variable name", c); } + return 0; } if (!is_identchar(c)) { pushback(c); テストケースは、正直どこにどう書けばいいのかわからんです。 それでも敢えて書くなら sample/test.rb に以下を追加でしょうか。 test_ok(nil == (begin eval "@0..0"; rescue Exception; nil end)) でも test.rb 中のどの辺りに書けばいいのかわかりませんし、 他のテストと比べても浮いている気がします。 -- Yusuke ENDOH