summaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-09-07 01:45:40 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-09-07 01:45:40 +0000
commit55b5e19d5b6464a815879a935f8d64a9c4fcb3a8 (patch)
tree0314d537580df8a3ff08d737d504ac3989aa0aa8 /eval.c
parent396332e7499f4b95a5a6951b7b15685f7063d6a7 (diff)
downloadruby-55b5e19d5b6464a815879a935f8d64a9c4fcb3a8.tar.gz
ruby-55b5e19d5b6464a815879a935f8d64a9c4fcb3a8.tar.xz
ruby-55b5e19d5b6464a815879a935f8d64a9c4fcb3a8.zip
* eval.c (rb_thread_switch): convert all exceptions to
SystemExit. fixed: [ruby-core:05724] * eval.c (rb_thread_terminated): show backtrace before propagate exceptions to main thread. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@9092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/eval.c b/eval.c
index f1f8fd8a5..e305a3b82 100644
--- a/eval.c
+++ b/eval.c
@@ -10067,6 +10067,9 @@ rb_thread_switch(n)
case RESTORE_EXIT:
ruby_errinfo = th_raise_exception;
ruby_current_node = th_raise_node;
+ if (!rb_obj_is_kind_of(ruby_errinfo, rb_eSystemExit)) {
+ terminate_process(EXIT_FAILURE, ruby_errinfo);
+ }
rb_exc_raise(th_raise_exception);
break;
case RESTORE_NORMAL:
@@ -11623,6 +11626,7 @@ rb_thread_start_0(fn, arg, th)
}
else if (th->safe < 4 && (ruby_thread_abort || th->abort || RTEST(ruby_debug))) {
/* exit on main_thread */
+ error_print();
rb_thread_main_jump(ruby_errinfo, RESTORE_EXIT);
}
else {