* eval.c (ruby_cleanup): inversed the order of errinfos.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
dc8147bca9
commit
e110a86cc5
18
eval.c
18
eval.c
@ -153,17 +153,17 @@ ruby_finalize(void)
|
|||||||
int
|
int
|
||||||
ruby_cleanup(int ex)
|
ruby_cleanup(int ex)
|
||||||
{
|
{
|
||||||
int state, nerr;
|
int state;
|
||||||
VALUE err;
|
|
||||||
rb_thread_t *th = GET_THREAD();
|
|
||||||
volatile VALUE errs[2];
|
volatile VALUE errs[2];
|
||||||
|
rb_thread_t *th = GET_THREAD();
|
||||||
rb_vm_t *vm = th->vm;
|
rb_vm_t *vm = th->vm;
|
||||||
|
int nerr;
|
||||||
|
|
||||||
errs[0] = th->errinfo;
|
errs[1] = th->errinfo;
|
||||||
th->safe_level = 0;
|
th->safe_level = 0;
|
||||||
Init_stack((void *)&state);
|
Init_stack((void *)&state);
|
||||||
ruby_finalize_0();
|
ruby_finalize_0();
|
||||||
errs[1] = th->errinfo;
|
errs[0] = th->errinfo;
|
||||||
PUSH_THREAD_TAG();
|
PUSH_THREAD_TAG();
|
||||||
if ((state = EXEC_TAG()) == 0) {
|
if ((state = EXEC_TAG()) == 0) {
|
||||||
rb_thread_terminate_all();
|
rb_thread_terminate_all();
|
||||||
@ -171,14 +171,16 @@ ruby_cleanup(int ex)
|
|||||||
else if (ex == 0) {
|
else if (ex == 0) {
|
||||||
ex = state;
|
ex = state;
|
||||||
}
|
}
|
||||||
th->errinfo = errs[0];
|
th->errinfo = errs[1];
|
||||||
ex = error_handle(ex);
|
ex = error_handle(ex);
|
||||||
ruby_finalize_1();
|
ruby_finalize_1();
|
||||||
POP_THREAD_TAG();
|
POP_THREAD_TAG();
|
||||||
rb_thread_stop_timer_thread();
|
rb_thread_stop_timer_thread();
|
||||||
|
|
||||||
for (nerr = sizeof(errs) / sizeof(errs[0]); nerr;) {
|
for (nerr = 0; nerr < sizeof(errs) / sizeof(errs[0]); ++nerr) {
|
||||||
if (!RTEST(err = errs[--nerr])) continue;
|
VALUE err = errs[nerr];
|
||||||
|
|
||||||
|
if (!RTEST(err)) continue;
|
||||||
|
|
||||||
/* th->errinfo contains a NODE while break'ing */
|
/* th->errinfo contains a NODE while break'ing */
|
||||||
if (TYPE(err) == T_NODE) continue;
|
if (TYPE(err) == T_NODE) continue;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user