From: wanabe Date: 2007-03-23T10:25:44+09:00 Subject: [ruby-dev:30671] invalid CFP in rb_protect ワナベです。 1.9 trunkで以下のようなテストコードを動かすと [BUG] cfp consistency error - call0 で落ちます。 --- ここから class A def inspect raise end end class B def initialize @a = A.new undefined_method end end B.new --- ここまで NameError のメッセージを作成するときの、inspect の呼び出しにかませている rb_protect が原因のようです。 以下、パッチです。 Index: eval.c =================================================================== --- eval.c (revision 12109) +++ eval.c (working copy) @@ -1390,6 +1390,8 @@ { VALUE result = Qnil; /* OK */ int status; + rb_thread_t *th = GET_THREAD(); + rb_control_frame_t *reg_cfp = th->cfp; PUSH_THREAD_TAG(); if ((status = EXEC_TAG()) == 0) { @@ -1400,6 +1402,7 @@ *state = status; } if (status != 0) { + th->cfp = reg_cfp; return Qnil; } -- ワナベ