diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-10-09 05:05:43 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-10-09 05:05:43 +0000 |
commit | 582b7e1ca9b1fe56516d84698cbfaad7ee317bad (patch) | |
tree | cebd5826b7c41ea010f560d69504b1e94d5fc981 | |
parent | 894d8d9e618d352a1a54f19210f6e1d99d18cdd8 (diff) | |
download | ruby-582b7e1ca9b1fe56516d84698cbfaad7ee317bad.tar.gz |
* eval.c (rb_set_end_proc, rb_exec_end_proc): restore safe level.
[ruby-dev:21557]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | eval.c | 6 |
2 files changed, 11 insertions, 0 deletions
@@ -1,3 +1,8 @@ +Thu Oct 9 14:05:38 2003 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * eval.c (rb_set_end_proc, rb_exec_end_proc): restore safe level. + [ruby-dev:21557] + Thu Oct 9 10:51:04 2003 Nobuyoshi Nakada <nobu@ruby-lang.org> * eval.c (rb_yield_0): no error if block is empty. @@ -6406,6 +6406,7 @@ NORETURN(static VALUE rb_f_throw _((int,VALUE*))); struct end_proc_data { void (*func)(); VALUE data; + int safe; struct end_proc_data *next; }; @@ -6424,6 +6425,7 @@ rb_set_end_proc(func, data) link->next = *list; link->func = func; link->data = data; + link->safe = ruby_safe_level; *list = link; } @@ -6489,6 +6491,7 @@ rb_exec_end_proc() { struct end_proc_data *link, *tmp; int status; + volatile int safe = ruby_safe_level; while (ephemeral_end_procs) { link = ephemeral_end_procs; @@ -6496,6 +6499,7 @@ rb_exec_end_proc() while (link) { PUSH_TAG(PROT_NONE); if ((status = EXEC_TAG()) == 0) { + ruby_safe_level = link->safe; (*link->func)(link->data); } POP_TAG(); @@ -6513,6 +6517,7 @@ rb_exec_end_proc() while (link) { PUSH_TAG(PROT_NONE); if ((status = EXEC_TAG()) == 0) { + ruby_safe_level = link->safe; (*link->func)(link->data); } POP_TAG(); @@ -6524,6 +6529,7 @@ rb_exec_end_proc() free(tmp); } } + ruby_safe_level = safe; } void |