summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authorkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-29 02:09:36 +0000
committerkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-29 02:09:36 +0000
commit989c529c8999a03faf8c17c5b3068e73e632be6d (patch)
tree493fcbc1bcf6f3df17c2566325e98fa6ac776baf /thread.c
parentf22f1fbb54f7a2d3088205bf951d255f41f8f034 (diff)
* 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
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/thread.c b/thread.c
index a75990ccfb..dae4194599 100644
--- a/thread.c
+++ b/thread.c
@@ -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 (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 {