diff --git a/ChangeLog b/ChangeLog index 39294a3e93..503675efd3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Wed Aug 17 23:58:05 2005 Nobuyoshi Nakada + + * eval.c (terminate_process): take String message. + + * eval.c (rb_thread_switch): propagate the exception caused thread + termination directly. fixed: [ruby-core:05552] + Wed Aug 17 21:20:05 2005 NARUSE, Yui * ext/nkf/lib/kconv.rb: ensure that symbol_to_option is private_class_method @@ -10,7 +17,7 @@ Wed Aug 17 00:05:46 2005 Yukihiro Matsumoto where a method is defined . * eval.c (rb_call0): restore preserved safe level in the method - execution. + execution. * parse.y (lambda): need separate block variable stack manipulation and lpar_beg maintenance. based on a patch found diff --git a/eval.c b/eval.c index 3197412bca..a0b31db0dd 100644 --- a/eval.c +++ b/eval.c @@ -4352,16 +4352,15 @@ rb_mod_protected_method_defined(mod, mid) return Qfalse; } -NORETURN(static VALUE terminate_process _((int, const char *, long))); +NORETURN(static VALUE terminate_process _((int, VALUE))); static VALUE -terminate_process(status, mesg, mlen) +terminate_process(status, mesg) int status; - const char *mesg; - long mlen; + VALUE mesg; { VALUE args[2]; args[0] = INT2NUM(status); - args[1] = rb_str_new(mesg, mlen); + args[1] = mesg; rb_exc_raise(rb_class_new_instance(2, args, rb_eSystemExit)); } @@ -4371,7 +4370,7 @@ rb_exit(status) int status; { if (prot_tag) { - terminate_process(status, "exit", 4); + terminate_process(status, rb_str_new("exit", 4)); } ruby_finalize(); exit(status); @@ -4476,9 +4475,9 @@ rb_f_abort(argc, argv) VALUE mesg; rb_scan_args(argc, argv, "1", &mesg); - StringValue(argv[0]); - rb_io_puts(argc, argv, rb_stderr); - terminate_process(EXIT_FAILURE, RSTRING(argv[0])->ptr, RSTRING(argv[0])->len); + StringValue(mesg); + rb_io_puts(1, &mesg, rb_stderr); + terminate_process(EXIT_FAILURE, mesg); } return Qnil; /* not reached */ } @@ -10489,7 +10488,7 @@ rb_thread_switch(n) case RESTORE_EXIT: ruby_errinfo = th_raise_exception; ruby_current_node = th_raise_node; - terminate_process(sysexit_status(ruby_errinfo), 0, 0); + rb_exc_raise(th_raise_exception); break; case RESTORE_NORMAL: default: