summaryrefslogtreecommitdiffstats
path: root/hash.c
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-13 07:25:05 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-13 07:25:05 +0000
commitbd380f25fd23a0e7b31f72a7cc1e32fc9f522992 (patch)
tree5d6a14de43873b9ddaec533051b942cf89c201ce /hash.c
parenta8821182f6f47f451afc330c9d48c4d85825c0b3 (diff)
downloadruby-bd380f25fd23a0e7b31f72a7cc1e32fc9f522992.tar.gz
ruby-bd380f25fd23a0e7b31f72a7cc1e32fc9f522992.tar.xz
ruby-bd380f25fd23a0e7b31f72a7cc1e32fc9f522992.zip
* object.c (rb_obj_untrusted): new method Object#untrusted?.
(rb_obj_untrust): new method Object#untrust. (rb_obj_trust): new method Object#trust. * array.c, debug.c, time.c, include/ruby/ruby.h, re.c, variable.c, string.c, io.c, dir.c, vm_method.c, struct.c, class.c, hash.c, ruby.c, marshal.c: fixes for Object#untrusted?. * test/ruby/test_module.rb, test/ruby/test_array.rb, test/ruby/test_object.rb, test/ruby/test_string.rb, test/ruby/test_marshal.rb, test/ruby/test_hash.rb: added tests for Object#untrusted?. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hash.c b/hash.c
index 89139e852..ee90a840b 100644
--- a/hash.c
+++ b/hash.c
@@ -247,7 +247,7 @@ static void
rb_hash_modify_check(VALUE hash)
{
if (OBJ_FROZEN(hash)) rb_error_frozen("hash");
- if (!OBJ_TAINTED(hash) && rb_safe_level() >= 4)
+ if (!OBJ_UNTRUSTED(hash) && rb_safe_level() >= 4)
rb_raise(rb_eSecurityError, "Insecure: can't modify hash");
}
@@ -1166,7 +1166,7 @@ rb_hash_to_a(VALUE hash)
ary = rb_ary_new();
rb_hash_foreach(hash, to_a_i, ary);
- if (OBJ_TAINTED(hash)) OBJ_TAINT(ary);
+ OBJ_INFECT(ary, hash);
return ary;
}