summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-05-14 16:39:15 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-05-14 16:39:15 +0000
commit6a60393280046a4991da8a415a77c60c7be240b5 (patch)
tree489d3ac0bc9d172e33965204600726fd5d4dbbef /eval.c
parent35ae7c90450157e1d8d415be819da40c9c1289a6 (diff)
* 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
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c41
1 files changed, 12 insertions, 29 deletions
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; i<n; i++) {
RARRAY(val)->ptr[i] = va_arg(args, VALUE);
}
+ RARRAY(val)->len = n;
va_end(args);
return rb_yield_0(val, 0, 0, 0, Qtrue);
}