* 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/trunk@34982 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2012-03-12 01:13:40 +00:00
parent 90b7ddb89f
commit b19f3a8a15
3 changed files with 23 additions and 0 deletions

View file

@ -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