summaryrefslogtreecommitdiff
path: root/variable.c
diff options
context:
space:
mode:
author(no author) <(no author)@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-04-14 14:35:50 +0000
committer(no author) <(no author)@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-04-14 14:35:50 +0000
commited131ebad88c2948d7b40f93ff6ce39f1eb8a2f7 (patch)
tree7bbf62c5e0d0bb8ff971637cf432c6f16824f8f6 /variable.c
parentbe1fea072cd0d22788ef8a931c0c6b64a2503b5d (diff)
This commit was manufactured by cvs2svn to create tag 'v1_4_4'.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/tags/v1_4_4@668 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'variable.c')
-rw-r--r--variable.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/variable.c b/variable.c
index 7b273933ac..5e041f876d 100644
--- a/variable.c
+++ b/variable.c
@@ -195,10 +195,20 @@ VALUE
rb_path2class(path)
const char *path;
{
+ VALUE c;
+
if (path[0] == '#') {
rb_raise(rb_eArgError, "can't retrieve anonymous class %s", path);
}
- return rb_eval_string(path);
+ c = rb_eval_string(path);
+ switch (TYPE(c)) {
+ case T_MODULE:
+ case T_CLASS:
+ break;
+ default:
+ rb_raise(rb_eTypeError, "class path %s does not point class", path);
+ }
+ return c;
}
void
@@ -694,6 +704,18 @@ rb_alias_variable(name1, name2)
static int special_generic_ivar = 0;
static st_table *generic_iv_tbl;
+st_table*
+rb_generic_ivar_table(obj)
+ VALUE obj;
+{
+ st_table *tbl;
+ VALUE val;
+
+ if (!generic_iv_tbl) return 0;
+ if (!st_lookup(generic_iv_tbl, obj, &tbl)) return 0;
+ return tbl;
+}
+
static VALUE
generic_ivar_get(obj, id)
VALUE obj;