зеркало из https://github.com/github/ruby.git
ruby.h: error only in the core
* include/ruby/ruby.h (RUBY_SAFE_LEVEL_CHECK): make only rb_set_safe_level(4) an error always but make rb_secure(4) an error only in the core. [ruby-dev:47517] [Bug #8652] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42037 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
6795b09fb9
Коммит
862bad2d2a
|
@ -1,3 +1,9 @@
|
|||
Thu Jul 18 15:45:47 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* include/ruby/ruby.h (RUBY_SAFE_LEVEL_CHECK): make only
|
||||
rb_set_safe_level(4) an error always but make rb_secure(4) an error
|
||||
only in the core. [ruby-dev:47517] [Bug #8652]
|
||||
|
||||
Thu Jul 18 15:42:01 2013 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* include/ruby/ruby.h: fix spell miss.
|
||||
|
|
|
@ -567,14 +567,19 @@ void rb_secure(int);
|
|||
int rb_safe_level(void);
|
||||
void rb_set_safe_level(int);
|
||||
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
|
||||
int ruby_safe_level_4(void) __attribute__((error("$SAFE=4 is obsolete")));
|
||||
int ruby_safe_level_4_error(void) __attribute__((error("$SAFE=4 is obsolete")));
|
||||
# ifdef RUBY_EXPORT
|
||||
# define ruby_safe_level_4_warning() ruby_safe_level_4_error()
|
||||
# else
|
||||
int ruby_safe_level_4_warning(void) __attribute__((warning("$SAFE=4 is obsolete")));
|
||||
# endif
|
||||
#define RUBY_SAFE_LEVEL_INVALID_P(level) \
|
||||
__extension__(__builtin_constant_p(level) && \
|
||||
((level) < 0 || RUBY_SAFE_LEVEL_MAX < (level)))
|
||||
#define RUBY_SAFE_LEVEL_CHECK(level) \
|
||||
(RUBY_SAFE_LEVEL_INVALID_P(level) ? ruby_safe_level_4() : (level))
|
||||
#define rb_secure(level) rb_secure(RUBY_SAFE_LEVEL_CHECK(level))
|
||||
#define rb_set_safe_level(level) rb_set_safe_level(RUBY_SAFE_LEVEL_CHECK(level))
|
||||
#define RUBY_SAFE_LEVEL_CHECK(level, type) \
|
||||
(RUBY_SAFE_LEVEL_INVALID_P(level) ? ruby_safe_level_4_##type() : (level))
|
||||
#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))
|
||||
#endif
|
||||
void rb_set_safe_level_force(int);
|
||||
void rb_secure_update(VALUE);
|
||||
|
|
Загрузка…
Ссылка в новой задаче