ruby-changes:25906
From: kosaki <ko1@a...>
Date: Thu, 29 Nov 2012 11:11:15 +0900 (JST)
Subject: [ruby-changes:25906] kosaki:r37963 (trunk): * thread.c (thread_start_func_2): remove unused code. When
kosaki 2012-11-29 11:09:36 +0900 (Thu, 29 Nov 2012) New Revision: 37963 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=37963 Log: * 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. Modified files: trunk/ChangeLog trunk/thread.c Index: ChangeLog =================================================================== --- ChangeLog (revision 37962) +++ ChangeLog (revision 37963) @@ -1,3 +1,9 @@ +Thu Nov 29 11:06:06 2012 KOSAKI Motohiro <kosaki.motohiro@g...> + + * 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@a...> * vm_backtrace.c: same as a last patch. Index: thread.c =================================================================== --- thread.c (revision 37962) +++ thread.c (revision 37963) @@ -491,16 +491,15 @@ if (state == TAG_FATAL) { /* fatal error within this thread, need to stop whole script */ } + else if (th->safe_level >= 4) { + /* Ignore it. Main thread shouldn't be harmed from untrusted thread. */ + errinfo = Qnil; + } 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; - } + /* exit on main_thread. */ } - else if (th->safe_level < 4 && - (th->vm->thread_abort_on_exception || - th->abort_on_exception || RTEST(ruby_debug))) { + else if (th->vm->thread_abort_on_exception || + th->abort_on_exception || RTEST(ruby_debug)) { /* exit on main_thread */ } else { -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/