Hi,

At Fri, 23 Mar 2007 12:39:48 +0900,
Alexey Verkhovsky wrote in [ruby-core:10746]:
> OK, take Test::Unit out of the equation, too. Ruby 1.8.6
> ignores the argument to exit(), if inside the at_exit block.

Sorry, it's a weird side effect of the fix for [ruby-core:9675].


Index: eval.c =================================================================== --- eval.c (revision 12124) +++ eval.c (working copy) @@ -1563,9 +1563,13 @@ ruby_cleanup(ex) { int state; - volatile VALUE err = ruby_errinfo; + VALUE err; + volatile VALUE errs[2]; + int nerr; + errs[0] = ruby_errinfo; ruby_safe_level = 0; Init_stack((void*)&state); ruby_finalize_0(); + errs[1] = ruby_errinfo; PUSH_TAG(PROT_NONE); PUSH_ITER(ITER_NOT); @@ -1578,13 +1582,13 @@ ruby_cleanup(ex) } POP_ITER(); - ruby_errinfo = err; + ruby_errinfo = errs[0]; ex = error_handle(ex); ruby_finalize_1(); POP_TAG(); - if (err) { + for (nerr = sizeof(errs) / sizeof(errs[0]); nerr;) { + if (!(err = errs[--nerr])) continue; if (rb_obj_is_kind_of(err, rb_eSystemExit)) { - VALUE st = rb_iv_get(err, "status"); - return NUM2INT(st); + return sysexit_status(err); } else if (rb_obj_is_kind_of(err, rb_eSignal)) {
-- Nobu Nakada