From 6a60393280046a4991da8a415a77c60c7be240b5 Mon Sep 17 00:00:00 2001 From: matz Date: Fri, 14 May 2004 16:39:15 +0000 Subject: * range.c (range_each_func): terminates loop if generating value is same to @end. [ruby-talk:100269] * string.c (rb_str_new4): should not reuse frozen shared string if the original is not an instance of String. [ruby-talk:100193] * time.c (time_mdump): preserve GMT bit in the marshal data. [ruby-talk:100213] * eval.c (is_defined): do not protect exception during receiver evaluation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6313 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- eval.c | 41 ++++++++++++----------------------------- 1 file changed, 12 insertions(+), 29 deletions(-) (limited to 'eval.c') diff --git a/eval.c b/eval.c index 56adf06171..97369021ab 100644 --- a/eval.c +++ b/eval.c @@ -2225,15 +2225,7 @@ is_defined(self, node, buf) val = self; if (node->nd_recv == (NODE *)1) goto check_bound; case NODE_CALL: - PUSH_TAG(PROT_NONE); - if ((state = EXEC_TAG()) == 0) { - val = rb_eval(self, node->nd_recv); - } - POP_TAG(); - if (state) { - ruby_errinfo = Qnil; - return 0; - } + val = rb_eval(self, node->nd_recv); check_bound: { int call = nd_type(node)==NODE_CALL; @@ -2324,26 +2316,16 @@ is_defined(self, node, buf) break; case NODE_COLON2: - PUSH_TAG(PROT_NONE); - if ((state = EXEC_TAG()) == 0) { - val = rb_eval(self, node->nd_head); - } - POP_TAG(); - if (state) { - ruby_errinfo = Qnil; - return 0; - } - else { - switch (TYPE(val)) { - case T_CLASS: - case T_MODULE: - if (rb_const_defined_from(val, node->nd_mid)) - return "constant"; - break; - default: - if (rb_method_boundp(CLASS_OF(val), node->nd_mid, 1)) { - return "method"; - } + val = rb_eval(self, node->nd_head); + switch (TYPE(val)) { + case T_CLASS: + case T_MODULE: + if (rb_const_defined_from(val, node->nd_mid)) + return "constant"; + break; + default: + if (rb_method_boundp(CLASS_OF(val), node->nd_mid, 1)) { + return "method"; } } break; @@ -4809,6 +4791,7 @@ rb_yield_values(n, va_alist) for (i=0; iptr[i] = va_arg(args, VALUE); } + RARRAY(val)->len = n; va_end(args); return rb_yield_0(val, 0, 0, 0, Qtrue); } -- cgit v1.2.3