From: Yusuke ENDOH Date: 2007-07-02T19:53:08+09:00 Subject: [ruby-dev:31110] ary[]+=1 dumps core 遠藤と申します。 1.9 で以下のようにすると落ちます。 $ ./ruby -e 'ary[]+=1' -- control frame ---------- c:0001 p:---- s:0001 b:-001 l:000000 d:000000 ------ --------------------------- -- backtrace of native function call (Use addr2line) -- 0x80dac65 0x80f3ec0 0x810a349 0x8105841 0x810ad37 0x80d01a2 0x80d0276 0x80dbac2 0x80dbb26 0x8059052 0x8059076 0x805d601 0x8056d2f 0xb7dacea8 0x8056c61 ------------------------------------------------------- [BUG] compile_array: This node is not NODE_ARRAY, but NODE_ZARRAY ruby 1.9.0 (2007-07-02) [i686-linux] アボートしました (core dumped) とりあえず以下のパッチで落ちなくなります。 ちゃんと考えていない応急処置なのでまだ問題があるかもしれません。 あと、変更点を明示するために敢えてインデントを変えていません。 Index: compile.c =================================================================== --- compile.c (revision 12678) +++ compile.c (working copy) @@ -1831,6 +1831,7 @@ int len = node->nd_alen, line = nd_line(node), i=0; DECL_ANCHOR(anchor); +if(nd_type(node) != NODE_ZARRAY) { while (node) { if (nd_type(node) != NODE_ARRAY) { rb_bug("compile_array: This node is not NODE_ARRAY, but %s", @@ -1844,6 +1845,7 @@ COMPILE(anchor, "array element", node->nd_head); node = node->nd_next; } +} if (len != i) { if (0) rb_bug("node error: compile_array (%d: %d-%d)", -- Yusuke ENDOH