summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--eval.c6
2 files changed, 11 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index abaacb8141..756b7bbc60 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
diff --git a/eval.c b/eval.c
index 9d3ce0867a..edb488b595 100644
--- a/eval.c
+++ b/eval.c
@@ -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