diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-06-18 14:33:12 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-06-18 14:33:12 +0000 |
commit | a9b06707d99ea09d34823ae68aa3b874f5a661f8 (patch) | |
tree | aa5cb4f6cd288c613d43cf4b4c6c957396f0e83a /include | |
parent | 65ab26604bab94a49546512785aae788ddb76141 (diff) |
$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.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50960 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include')
-rw-r--r-- | include/ruby/ruby.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h index 50dcd60167..a27fc5d637 100644 --- a/include/ruby/ruby.h +++ b/include/ruby/ruby.h @@ -589,7 +589,7 @@ int ruby_safe_level_2_warning(void) __attribute__((warning("$SAFE=2 to 4 are obs __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) __attribute__((warning("$SAFE=2 to 4 are obs __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)) |