summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-10-29 05:04:45 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-10-29 05:04:45 +0000
commit35b21a12c03765244d32b6400a100124f35df091 (patch)
tree7cc9ed3bebd8006d18cdac6f833cfd611f705ff1 /eval.c
parentb07291635892b07bb4afbb62d4fe08aa8dfeb68b (diff)
* parse.y (str_extend): shuould allow interpolation of $-x.
* bignum.c (rb_big_eq): convert Bignum to Float, instead of reverse. * time.c (time_localtime): getting tm should not be prohibited for frozen time objects. * time.c (time_gmtime): ditto. * version.c (Init_version): freeze RUBY_VERSION, RUBY_RELEASE_DATE, and RUBY_PLATFORM. * file.c (Init_File): freeze File::SEPARATOR, ALT_SEPARATOR and PATH_SEPARATOR. * file.c (rb_stat_cmp): should check operand type before calling get_stat(). * eval.c (rb_eval_cmd): should not invoke "call" with a block on any occasion. * numeric.c (fix_aref): idx may be a Bignum. * numeric.c (num_remainder): a bug in Numeric#remainder. * eval.c (rb_exec_end_proc): END might be called within END block. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@1799 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/eval.c b/eval.c
index 2d17ad1bea..a8773e181a 100644
--- a/eval.c
+++ b/eval.c
@@ -1319,8 +1319,10 @@ rb_eval_cmd(cmd, arg)
volatile int safe = ruby_safe_level;
if (TYPE(cmd) != T_STRING) {
- return rb_funcall2(cmd, rb_intern("call"),
- RARRAY(arg)->len, RARRAY(arg)->ptr);
+ PUSH_ITER(ITER_NOT);
+ val = rb_funcall2(cmd, rb_intern("call"), RARRAY(arg)->len, RARRAY(arg)->ptr);
+ POP_ITER();
+ return val;
}
saved_scope = ruby_scope;
@@ -5877,10 +5879,10 @@ rb_f_at_exit()
void
rb_exec_end_proc()
{
- struct end_proc_data *link;
+ struct end_proc_data *link, *save;
int status;
- link = end_procs;
+ save = link = end_procs;
while (link) {
rb_protect((VALUE(*)())link->func, link->data, &status);
if (status) {
@@ -5888,6 +5890,14 @@ rb_exec_end_proc()
}
link = link->next;
}
+ link = end_procs;
+ while (link != save) {
+ rb_protect((VALUE(*)())link->func, link->data, &status);
+ if (status) {
+ error_handle(status);
+ }
+ link = link->next;
+ }
while (ephemeral_end_procs) {
link = ephemeral_end_procs;
ephemeral_end_procs = link->next;