diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-01-17 08:37:53 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-01-17 08:37:53 +0000 |
commit | dde62bcd2efbb3825d982326896ab774e73e4218 (patch) | |
tree | 6a421d3818dd390cf8f6b2c5544726a8950e1401 /eval.c | |
parent | e43877719bd4bbd12e493e896a0f98c5b349937b (diff) |
2000-01-17
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@606 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 18 |
1 files changed, 15 insertions, 3 deletions
@@ -239,6 +239,7 @@ search_method(klass, id, origin) { NODE *body; + if (!klass) return 0; while (!st_lookup(RCLASS(klass)->m_tbl, id, &body)) { klass = RCLASS(klass)->super; if (!klass) return 0; @@ -2284,6 +2285,11 @@ rb_eval(self, node) rb_eval(self, node->nd_body)); break; + case NODE_ARGSPUSH: + result = rb_ary_push(rb_eval(self, node->nd_head), + rb_eval(self, node->nd_body)); + break; + case NODE_CALL: { VALUE recv; @@ -3333,10 +3339,13 @@ rb_yield_0(val, self, klass, acheck) !FL_TEST(ruby_dyna_vars, DVAR_DONT_RECYCLE)) { struct RVarmap *vars = ruby_dyna_vars; - do { + while (vars && vars->id != 0) { rb_gc_force_recycle((VALUE)vars); vars = vars->next; - } while (vars && vars->id != 0); + } + if (ruby_dyna_vars->id == 0) { + rb_gc_force_recycle((VALUE)ruby_dyna_vars); + } } POP_VARS(); ruby_block = block; @@ -3379,7 +3388,10 @@ massign(self, node, val, check) if (val) { if (TYPE(val) != T_ARRAY) { - val = rb_Array(val); + if (NIL_P(val)) + val = rb_ary_new2(0); + else + val = rb_ary_new3(1, val); } len = RARRAY(val)->len; for (i=0; list && i<len; i++) { |