summaryrefslogtreecommitdiff
path: root/variable.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-10-06 03:28:28 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-10-06 03:28:28 +0000
commit75ff8fdb16fa0a733512e61350c9844ea530ad35 (patch)
treea057e60543c77d6e20ea2e91928928df80b2b6d3 /variable.c
parent5d71c8d89c6bd7af934e7a8de5882cda2991711b (diff)
join 1.1c6
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1dev@310 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'variable.c')
-rw-r--r--variable.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/variable.c b/variable.c
index 3cebfb4ecb..14b5cf4390 100644
--- a/variable.c
+++ b/variable.c
@@ -722,9 +722,6 @@ rb_ivar_set(obj, id, val)
ID id;
VALUE val;
{
- if (rb_safe_level() >= 5) {
- rb_raise(rb_eSecurityError, "cannot change object status");
- }
switch (TYPE(obj)) {
case T_OBJECT:
case T_CLASS:
@@ -1037,6 +1034,10 @@ rb_define_const(klass, name, val)
VALUE val;
{
ID id = rb_intern(name);
+
+ if (klass == rb_cObject) {
+ rb_secure(4);
+ }
if (!rb_is_const_id(id)) {
rb_raise(rb_eNameError, "wrong constant name %s", name);
}