From: matz@... (Yukihiro Matsumoto) Date: 2003-05-27T02:37:58+09:00 Subject: Re: [1.8] terminated object / invalid inspect_tbl Hi, In message "Re: [1.8] terminated object / invalid inspect_tbl" on 03/05/27, nobu.nokada@softhome.net writes: |> Well, it work with hook (I must stop to write stupid thing :-))) | |Have you implemented method hook? Yeah, I'd like to see the code. |Anyway, this seems to work. Here's my fix. matz. --- eval.c 26 May 2003 08:22:27 -0000 1.445 +++ eval.c 26 May 2003 17:36:52 -0000 @@ -97,3 +97,3 @@ VALUE rb_cBlock, rb_cProc; static VALUE rb_cBinding; -static VALUE block_invoke _((VALUE,VALUE,VALUE)); +static VALUE block_invoke _((VALUE,VALUE,VALUE,VALUE)); static VALUE block_new _((void)); @@ -2249,3 +2249,3 @@ call_trace_func(event, node, self, id, k klass), - Qundef); + Qundef, 0); } @@ -4046,3 +4046,3 @@ rb_yield_0(val, self, klass, pcall, aval } - ruby_class = klass?klass:block->klass; + ruby_class = klass ? klass : block->klass; if (!klass) self = block->self; @@ -4887,3 +4887,3 @@ rb_call0(klass, recv, id, oid, argc, arg case NODE_BMETHOD: - result = block_invoke(body->nd_cval, rb_ary_new4(argc, argv), recv); + result = block_invoke(body->nd_cval, rb_ary_new4(argc, argv), recv, klass); break; @@ -6366,3 +6366,3 @@ call_end_proc(data) ruby_frame->last_class = 0; - block_invoke(data, rb_ary_new2(0), Qundef); + block_invoke(data, rb_ary_new2(0), Qundef, 0); POP_FRAME(); @@ -6880,5 +6880,5 @@ block_orphan(data) static VALUE -block_invoke(block, args, self) +block_invoke(block, args, self, klass) VALUE block, args; /* OK */ - VALUE self; + VALUE self, klass; { @@ -6910,3 +6910,4 @@ block_invoke(block, args, self) _block = *data; - _block.frame.self = self; + if (self != Qundef) _block.frame.self = self; + if (klass) _block.frame.last_class = klass; ruby_block = &_block; @@ -6968,3 +6969,3 @@ block_call(block, args) { - return block_invoke(block, args, Qundef); + return block_invoke(block, args, Qundef, 0); }