[前][次][番号順一覧][スレッド一覧]

ruby-changes:36498

From: nobu <ko1@a...>
Date: Wed, 26 Nov 2014 17:02:01 +0900 (JST)
Subject: [ruby-changes:36498] nobu:r48580 (trunk): proc.c: use RUBY_SAFE_LEVEL_MAX

nobu	2014-11-26 17:01:56 +0900 (Wed, 26 Nov 2014)

  New Revision: 48580

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=48580

  Log:
    proc.c: use RUBY_SAFE_LEVEL_MAX
    
    * proc.c (rb_method_call_with_block): use RUBY_SAFE_LEVEL_MAX,
      which is declared in include/ruby/ruby.h since 2.1.  The safe
      level is now limited upto 3.

  Modified files:
    trunk/proc.c
Index: proc.c
===================================================================
--- proc.c	(revision 48579)
+++ proc.c	(revision 48580)
@@ -1828,9 +1828,9 @@ rb_method_call_with_block(int argc, cons https://github.com/ruby/ruby/blob/trunk/proc.c#L1828
     }
     PUSH_TAG();
     if (OBJ_TAINTED(method)) {
-	const int safe_level_to_run = 4 /*SAFE_LEVEL_MAX*/;
+	const int safe_level_to_run = RUBY_SAFE_LEVEL_MAX;
 	safe = rb_safe_level();
-	if (rb_safe_level() < safe_level_to_run) {
+	if (safe < safe_level_to_run) {
 	    rb_set_safe_level_force(safe_level_to_run);
 	}
     }

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]