From 429f7ed113dc862b121ab63c73170e4169853581 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 22 Oct 2001 16:28:51 +0000 Subject: * eval.c (proc_invoke): fix self switching in Proc#call (ruby-bugs-ja#PR108) and GC failure. use Qundef instead of 0 to direct not switching self. * eval.c (call_trace_func): ditto. * eval.c (call_end_proc): ditto. * eval.c (proc_call): ditto. * eval.c (proc_yield): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1798 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- eval.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'eval.c') diff --git a/eval.c b/eval.c index 943b2e3dba..e31c5986c9 100644 --- a/eval.c +++ b/eval.c @@ -2018,7 +2018,7 @@ call_trace_func(event, file, line, self, id, klass) id?ID2SYM(id):Qnil, self?rb_f_binding(self):Qnil, klass), - Qtrue, 0); + Qtrue, Qundef); } POP_TMPTAG(); /* do not propagate retval */ POP_FRAME(); @@ -5931,7 +5931,7 @@ call_end_proc(data) ruby_frame->self = ruby_frame->prev->self; ruby_frame->last_func = 0; ruby_frame->last_class = 0; - proc_invoke(data, rb_ary_new2(0), Qfalse, 0); + proc_invoke(data, rb_ary_new2(0), Qfalse, Qundef); POP_FRAME(); POP_ITER(); } @@ -6451,7 +6451,7 @@ proc_invoke(proc, args, pcall, self) state = EXEC_TAG(); if (state == 0) { proc_set_safe_level(proc); - result = rb_yield_0(args, self, self?self:ruby_block->self, pcall); + result = rb_yield_0(args, self, self!=Qundef?CLASS_OF(self):0, pcall); } POP_TAG(); @@ -6488,14 +6488,14 @@ static VALUE proc_call(proc, args) VALUE proc, args; /* OK */ { - return proc_invoke(proc, args, Qtrue, 0); + return proc_invoke(proc, args, Qtrue, Qundef); } static VALUE proc_yield(proc, args) VALUE proc, args; /* OK */ { - return proc_invoke(proc, args, Qfalse, 0); + return proc_invoke(proc, args, Qfalse, Qundef); } static VALUE -- cgit v1.2.3