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.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48580 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2014-11-26 08:01:56 +00:00
parent f0071d3b31
commit 058044c211

4
proc.c
View File

@ -1828,9 +1828,9 @@ rb_method_call_with_block(int argc, const VALUE *argv, VALUE method, VALUE pass_
}
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);
}
}