summaryrefslogtreecommitdiff
path: root/eval_jump.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-04-22 06:09:29 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-04-22 06:09:29 (GMT)
commit1fbe0943cc9b54050d9dbdac01d8bef9b2f48202 (patch)
treea36b96a84d8670d977c545539deabd08e27890bd /eval_jump.c
parent219f68abfeb4a42ff6eac89e550a8b98bde08cb3 (diff)
eval_jump.c: restore previous error info
* eval_jump.c (exec_end_procs_chain): restore previous error info for each end procs. [ruby-core:75038] [Bug #12302] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54681 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval_jump.c')
-rw-r--r--eval_jump.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/eval_jump.c b/eval_jump.c
index 88fc5a2..59dae10 100644
--- a/eval_jump.c
+++ b/eval_jump.c
@@ -94,10 +94,11 @@ rb_mark_end_proc(void)
}
static void
-exec_end_procs_chain(struct end_proc_data *volatile *procs)
+exec_end_procs_chain(struct end_proc_data *volatile *procs, VALUE *errp)
{
struct end_proc_data volatile endproc;
struct end_proc_data *link;
+ VALUE errinfo = *errp;
while ((link = *procs) != 0) {
*procs = link->next;
@@ -105,6 +106,7 @@ exec_end_procs_chain(struct end_proc_data *volatile *procs)
xfree(link);
rb_set_safe_level_force(endproc.safe);
(*endproc.func) (endproc.data);
+ *errp = errinfo;
}
}
@@ -119,8 +121,8 @@ rb_exec_end_proc(void)
TH_PUSH_TAG(th);
if ((status = EXEC_TAG()) == 0) {
again:
- exec_end_procs_chain(&ephemeral_end_procs);
- exec_end_procs_chain(&end_procs);
+ exec_end_procs_chain(&ephemeral_end_procs, &th->errinfo);
+ exec_end_procs_chain(&end_procs, &th->errinfo);
}
else {
VAR_INITIALIZED(th);