* thread.c (thread_start_func_2): remove unused code. When

th->safe_level == 4, th->errinfo never be thrown. So, to
  create new exception makes no sense.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37963 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
kosaki 2012-11-29 02:09:36 +00:00
Родитель f22f1fbb54
Коммит 989c529c89
2 изменённых файлов: 14 добавлений и 9 удалений

Просмотреть файл

@ -1,3 +1,9 @@
Thu Nov 29 11:06:06 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
* thread.c (thread_start_func_2): remove unused code. When
th->safe_level == 4, th->errinfo never be thrown. So, to
create new exception makes no sense.
Thu Nov 29 10:29:53 2012 Koichi Sasada <ko1@atdot.net>
* vm_backtrace.c: same as a last patch.

Просмотреть файл

@ -491,16 +491,15 @@ thread_start_func_2(rb_thread_t *th, VALUE *stack_start, VALUE *register_stack_s
if (state == TAG_FATAL) {
/* fatal error within this thread, need to stop whole script */
}
else if (rb_obj_is_kind_of(errinfo, rb_eSystemExit)) {
if (th->safe_level >= 4) {
th->errinfo = rb_exc_new3(rb_eSecurityError,
rb_sprintf("Insecure exit at level %d", th->safe_level));
errinfo = Qnil;
}
else if (th->safe_level >= 4) {
/* Ignore it. Main thread shouldn't be harmed from untrusted thread. */
errinfo = Qnil;
}
else if (th->safe_level < 4 &&
(th->vm->thread_abort_on_exception ||
th->abort_on_exception || RTEST(ruby_debug))) {
else if (rb_obj_is_kind_of(errinfo, rb_eSystemExit)) {
/* exit on main_thread. */
}
else if (th->vm->thread_abort_on_exception ||
th->abort_on_exception || RTEST(ruby_debug)) {
/* exit on main_thread */
}
else {