summaryrefslogtreecommitdiff
path: root/eval_jump.c
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-02-22 05:28:36 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-02-22 05:28:36 +0000
commit18488c1117dfcb492694b2733cd96dba3602aae3 (patch)
tree05b9efa7f72ebb2a55b33d6c00ed012c37d8fd06 /eval_jump.c
parentbdcd3d62a82d8913d1735e05f1380b84edf6914c (diff)
merge revision(s) 34982: [Backport #5218]
* eval_jump.c (rb_exec_end_proc): remember the latest exit status. [ruby-core:43173][Bug #5218] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@39378 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval_jump.c')
-rw-r--r--eval_jump.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/eval_jump.c b/eval_jump.c
index a8f04808ca..f3a1f78a3f 100644
--- a/eval_jump.c
+++ b/eval_jump.c
@@ -99,6 +99,8 @@ rb_exec_end_proc(void)
struct end_proc_data *volatile link;
int status;
volatile int safe = rb_safe_level();
+ rb_thread_t *th = GET_THREAD();
+ VALUE errinfo = th->errinfo;
while (ephemeral_end_procs) {
link = ephemeral_end_procs;
@@ -112,6 +114,7 @@ rb_exec_end_proc(void)
POP_TAG();
if (status) {
error_handle(status);
+ if (!NIL_P(th->errinfo)) errinfo = th->errinfo;
}
xfree(link);
}
@@ -128,10 +131,12 @@ rb_exec_end_proc(void)
POP_TAG();
if (status) {
error_handle(status);
+ if (!NIL_P(th->errinfo)) errinfo = th->errinfo;
}
xfree(link);
}
rb_set_safe_level_force(safe);
+ th->errinfo = errinfo;
}
void