summaryrefslogtreecommitdiff
path: root/variable.c
diff options
context:
space:
mode:
authorocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-05-13 08:56:40 +0000
committerocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-05-13 08:56:40 +0000
commit701243c468da4fc2fd3fd5fbe4e490e4f71f9c89 (patch)
treef43bb12b699c9e43fe1de374dd1d987a359c8c95 /variable.c
parentb1d0c69c05f05b1b3b3d5f903d9c1a71ba3835bf (diff)
* variable.c (generic_ivar_get): rb_attr_get should not warn.
[ruby-dev:26010] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8449 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'variable.c')
-rw-r--r--variable.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/variable.c b/variable.c
index 506657e..04d826b 100644
--- a/variable.c
+++ b/variable.c
@@ -842,9 +842,10 @@ rb_generic_ivar_table(obj)
}
static VALUE
-generic_ivar_get(obj, id)
+generic_ivar_get(obj, id, warn)
VALUE obj;
ID id;
+ int warn;
{
st_table *tbl;
VALUE val;
@@ -856,8 +857,9 @@ generic_ivar_get(obj, id)
}
}
}
-
- rb_warning("instance variable %s not initialized", rb_id2name(id));
+ if (warn) {
+ rb_warning("instance variable %s not initialized", rb_id2name(id));
+ }
return Qnil;
}
@@ -1008,13 +1010,12 @@ ivar_get(obj, id, warn)
break;
default:
if (FL_TEST(obj, FL_EXIVAR) || rb_special_const_p(obj))
- return generic_ivar_get(obj, id);
+ return generic_ivar_get(obj, id, warn);
break;
}
- if (warn && ruby_verbose) {
+ if (warn) {
rb_warning("instance variable %s not initialized", rb_id2name(id));
}
-
return Qnil;
}