summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-06-29 14:05:40 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-06-29 14:05:40 +0000
commit4df2cb80531c7cd4b10b0dea26f4687c4f74ff30 (patch)
tree80aa6c44314c4854b4ac8d2f2a288bce08e0cd96
parentd7ac2f0cd22999401c6057e7c05c87f474e22306 (diff)
* parse.y: use ARGSPUSH instead of ARGSCAT to prevent too much
splat expansion. * eval.c (when_check): need to handle ARGSPUSH as well. * eval.c (block_orphan): lambda and proc from method are always orphan. * gc.c (gc_mark_children): proper marking for NODE_BLOCK_PASS and NODE_LAMBDA. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog13
-rw-r--r--eval.c6
-rw-r--r--gc.c3
-rw-r--r--parse.y2
4 files changed, 22 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index f2cf27cf1c..55c395f3ac 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+Thu Jun 29 23:04:36 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * parse.y: use ARGSPUSH instead of ARGSCAT to prevent too much
+ splat expansion.
+
+ * eval.c (when_check): need to handle ARGSPUSH as well.
+
+ * eval.c (block_orphan): lambda and proc from method are always
+ orphan.
+
+ * gc.c (gc_mark_children): proper marking for NODE_BLOCK_PASS and
+ NODE_LAMBDA.
+
Thu Jun 29 22:47:30 2006 Tanaka Akira <akr@m17n.org>
* eval.c (SETUP_ARGS0): avoid GC problem.
diff --git a/eval.c b/eval.c
index 7b83172183..98899b5e19 100644
--- a/eval.c
+++ b/eval.c
@@ -2711,6 +2711,9 @@ when_check(NODE *tag, VALUE val, VALUE self)
case NODE_ARGSCAT:
if (when_check(tag->nd_head, val, self)) return Qtrue;
return when_check(tag->nd_body, val, self);
+ case NODE_ARGSPUSH:
+ if (when_check(tag->nd_head, val, self)) return Qtrue;
+ if (when_cond(val, rb_eval(self, tag->nd_body))) return Qtrue;
default:
if (when_cond(val, rb_eval(self, tag))) return Qtrue;
break;
@@ -8352,6 +8355,9 @@ proc_lambda(void)
static int
block_orphan(struct BLOCK *data)
{
+ if (data->flags & (BLOCK_LAMBDA|BLOCK_FROM_METHOD)) {
+ return 1;
+ }
if (data->scope->flags & SCOPE_NOSTACK) {
return 1;
}
diff --git a/gc.c b/gc.c
index 5fdf120cd1..34090d9b4c 100644
--- a/gc.c
+++ b/gc.c
@@ -794,7 +794,6 @@ gc_mark_children(VALUE ptr, int lev)
case NODE_RESBODY:
case NODE_CLASS:
case NODE_ARGS:
- case NODE_BLOCK_PASS:
gc_mark((VALUE)obj->as.node.u2.node, lev);
/* fall through */
case NODE_BLOCK: /* 1,3 */
@@ -834,6 +833,8 @@ gc_mark_children(VALUE ptr, int lev)
case NODE_MODULE:
case NODE_ALIAS:
case NODE_VALIAS:
+ case NODE_BLOCK_PASS:
+ case NODE_LAMBDA:
gc_mark((VALUE)obj->as.node.u1.node, lev);
/* fall through */
case NODE_METHOD: /* 2 */
diff --git a/parse.y b/parse.y
index 9089adff36..727bfb5189 100644
--- a/parse.y
+++ b/parse.y
@@ -7291,7 +7291,7 @@ arg_append(NODE *node1, NODE *node2)
node1->nd_head = arg_append(node1->nd_head, node2);
return node1;
default:
- return NEW_ARGSCAT(node1, node2);
+ return NEW_ARGSPUSH(node1, node2);
}
}