mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* eval.c (method_call): allow changing $SAFE. [ruby-dev:23713]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6476 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
eba13dbc04
commit
934064ba5a
2 changed files with 9 additions and 4 deletions
|
@ -1,3 +1,7 @@
|
|||
Sat Jun 19 13:24:15 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* eval.c (method_call): allow changing $SAFE. [ruby-dev:23713]
|
||||
|
||||
Sat Jun 19 01:10:12 2004 Kouhei Sutou <kou@cozmixng.org>
|
||||
|
||||
* sample/rss/tdiary_plugin/rss-recent.rb: added more information.
|
||||
|
|
9
eval.c
9
eval.c
|
@ -8724,7 +8724,7 @@ method_call(argc, argv, method)
|
|||
VALUE result = Qnil; /* OK */
|
||||
struct METHOD *data;
|
||||
int state;
|
||||
volatile int safe = ruby_safe_level;
|
||||
volatile int safe = -1;
|
||||
|
||||
Data_Get_Struct(method, struct METHOD, data);
|
||||
if (data->recv == Qundef) {
|
||||
|
@ -8732,15 +8732,16 @@ method_call(argc, argv, method)
|
|||
}
|
||||
PUSH_ITER(rb_block_given_p()?ITER_PRE:ITER_NOT);
|
||||
PUSH_TAG(PROT_NONE);
|
||||
if (OBJ_TAINTED(method) && ruby_safe_level < 4) {
|
||||
ruby_safe_level = 4;
|
||||
if (OBJ_TAINTED(method)) {
|
||||
safe = ruby_safe_level;
|
||||
if (ruby_safe_level < 4) ruby_safe_level = 4;
|
||||
}
|
||||
if ((state = EXEC_TAG()) == 0) {
|
||||
result = rb_call0(data->klass,data->recv,data->id,data->oid,argc,argv,data->body,0);
|
||||
}
|
||||
POP_TAG();
|
||||
POP_ITER();
|
||||
ruby_safe_level = safe;
|
||||
if (safe >= 0) ruby_safe_level = safe;
|
||||
if (state) JUMP_TAG(state);
|
||||
return result;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue