From: Yusuke ENDOH Date: 2008-01-28T20:54:30+09:00 Subject: [ruby-dev:33468] get_destination_insn must not skip ADJUST 遠藤と申します。 1.9 が以下で落ちます。 $ ./ruby -e 'nil while ([0, (false ? 1 : redo; 2)])' -e:1: [BUG] Segmentation fault ruby 1.9.0 (2008-01-28 revision 15294) [i686-linux] -- control frame ---------- c:0003 p:0002 s:303206399 b:0006 l:000005 d:000005 TOP -e:1 c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH :inherited c:0001 p:0000 s:0002 b:0002 l:000001 d:000001 TOP :17 --------------------------- -- backtrace of native function call (Use addr2line) -- 0x80ef855 0x810e2ce 0x810e32b 0x80be760 0xffffe440 0x80ed264 0x80ed59d 0x805a7f9 0x805e940 0x8058221 0xb7dd2ea8 0x8058131 ------------------------------------------------------- アボートしました get_destination_insn が ADJUST を読み飛ばしているのが原因です。 以下で動きますが、他の問題を引き起こすかもしれません。 (line_no == -1 な ADJUST は読み飛ばすべき?とか) Index: compile.c =================================================================== --- compile.c (revision 15294) +++ compile.c (working copy) @@ -1320,7 +1320,7 @@ list = lobj->link.next; while (list) { - if (list->type == ISEQ_ELEMENT_INSN) { + if (list->type == ISEQ_ELEMENT_INSN || list->type == ISEQ_ELEMENT_ADJUST) { break; } list = list->next; -- Yusuke ENDOH