summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-10-06 17:59:53 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-10-06 17:59:53 +0000
commit8a4abe47cacd613a2d77287df75245fef6693246 (patch)
treee16415a5c89603a9adb4f968996d79f559c0f157 /eval.c
parent0dd4fde745f2c33a473ea3ee54b01a1d24d4586c (diff)
* parse.y (stmt): rhs of multiple assignment should not be
expanded using "to_a". [ruby-dev:21527] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c67
1 files changed, 34 insertions, 33 deletions
diff --git a/eval.c b/eval.c
index 6114efa7e0..bdd71486f5 100644
--- a/eval.c
+++ b/eval.c
@@ -2774,6 +2774,10 @@ rb_eval(self, n)
result = splat_value(rb_eval(self, node->nd_head));
break;
+ case NODE_TO_ARY:
+ result = rb_ary_to_ary(rb_eval(self, node->nd_head));
+ break;
+
case NODE_SVALUE:
result = avalue_splat(rb_eval(self, node->nd_head));
if (result == Qundef) result = Qnil;
@@ -6483,45 +6487,42 @@ rb_f_at_exit()
void
rb_exec_end_proc()
{
- struct end_proc_data *link, *save;
+ struct end_proc_data *link, *tmp;
int status;
- save = link = end_procs;
- while (link) {
- PUSH_TAG(PROT_NONE);
- if ((status = EXEC_TAG()) == 0) {
- (*link->func)(link->data);
- }
- POP_TAG();
- if (status) {
- error_handle(status);
- }
- link = link->next;
- }
- link = end_procs;
- while (link != save) {
- PUSH_TAG(PROT_NONE);
- if ((status = EXEC_TAG()) == 0) {
- (*link->func)(link->data);
- }
- POP_TAG();
- if (status) {
- error_handle(status);
- }
- link = link->next;
- }
while (ephemeral_end_procs) {
link = ephemeral_end_procs;
- ephemeral_end_procs = link->next;
- PUSH_TAG(PROT_NONE);
- if ((status = EXEC_TAG()) == 0) {
- (*link->func)(link->data);
+ ephemeral_end_procs = 0;
+ while (link) {
+ PUSH_TAG(PROT_NONE);
+ if ((status = EXEC_TAG()) == 0) {
+ (*link->func)(link->data);
+ }
+ POP_TAG();
+ if (status) {
+ error_handle(status);
+ }
+ tmp = link;
+ link = link->next;
+ free(tmp);
}
- POP_TAG();
- if (status) {
- error_handle(status);
+ }
+ while (end_procs) {
+ link = end_procs;
+ end_procs = 0;
+ while (link) {
+ PUSH_TAG(PROT_NONE);
+ if ((status = EXEC_TAG()) == 0) {
+ (*link->func)(link->data);
+ }
+ POP_TAG();
+ if (status) {
+ error_handle(status);
+ }
+ tmp = link;
+ link = link->next;
+ free(tmp);
}
- free(link);
}
}