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

ruby-changes:38879

From: nobu <ko1@a...>
Date: Thu, 18 Jun 2015 23:33:28 +0900 (JST)
Subject: [ruby-changes:38879] nobu:r50960 (trunk): $SAFE=2 is now obsolete

nobu	2015-06-18 23:33:12 +0900 (Thu, 18 Jun 2015)

  New Revision: 50960

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

  Log:
    $SAFE=2 is now obsolete
    
    * include/ruby/ruby.h (RUBY_SAFE_LEVEL_CHECK): fix safe_level
      limit.
    
    * vm_core.h (rb_proc_t): update comment for safe_level.

  Modified files:
    trunk/include/ruby/ruby.h
    trunk/vm_core.h
Index: include/ruby/ruby.h
===================================================================
--- include/ruby/ruby.h	(revision 50959)
+++ include/ruby/ruby.h	(revision 50960)
@@ -589,7 +589,7 @@ int ruby_safe_level_2_warning(void) __at https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L589
 	    __builtin_constant_p(level), \
 	    ((level) < 0 || RUBY_SAFE_LEVEL_MAX < (level)), 0))
 # define RUBY_SAFE_LEVEL_CHECK(level, type) \
-    __extension__(__builtin_choose_expr(RUBY_SAFE_LEVEL_INVALID_P(level), ruby_safe_level_3_##type(), (level)))
+    __extension__(__builtin_choose_expr(RUBY_SAFE_LEVEL_INVALID_P(level), ruby_safe_level_2_##type(), (level)))
 #else
 /* in gcc 4.8 or earlier, __builtin_choose_expr() does not consider
  * __builtin_constant_p(variable) a constant expression.
@@ -598,7 +598,7 @@ int ruby_safe_level_2_warning(void) __at https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L598
     __extension__(__builtin_constant_p(level) && \
 		  ((level) < 0 || RUBY_SAFE_LEVEL_MAX < (level)))
 # define RUBY_SAFE_LEVEL_CHECK(level, type) \
-    (RUBY_SAFE_LEVEL_INVALID_P(level) ? ruby_safe_level_3_##type() : (level))
+    (RUBY_SAFE_LEVEL_INVALID_P(level) ? ruby_safe_level_2_##type() : (level))
 #endif
 #define rb_secure(level) rb_secure(RUBY_SAFE_LEVEL_CHECK(level, warning))
 #define rb_set_safe_level(level) rb_set_safe_level(RUBY_SAFE_LEVEL_CHECK(level, error))
Index: vm_core.h
===================================================================
--- vm_core.h	(revision 50959)
+++ vm_core.h	(revision 50960)
@@ -796,7 +796,7 @@ typedef struct { https://github.com/ruby/ruby/blob/trunk/vm_core.h#L796
 
     VALUE envval;		/* for GC mark */
     VALUE blockprocval;
-    int8_t safe_level;		/* 0..3 */
+    int8_t safe_level;		/* 0..1 */
     int8_t is_from_method;	/* bool */
     int8_t is_lambda;		/* bool */
 } rb_proc_t;

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

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