summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-06-30 08:53:10 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-06-30 08:53:10 +0000
commit6e85f9c99c71c58d3f472c477fcd791328e7c492 (patch)
tree3c7eeb4e67e56b0ba2d3ae3c4be7b5e876ab3ef5 /eval.c
parenta40a92f04c6b3edeede0afcd939c17cff66f7d11 (diff)
* eval.c (mnew): ignore metaclasses have no influence, for rklass.
[ruby-talk:74706] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4017 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/eval.c b/eval.c
index 272d2f7..f634b65 100644
--- a/eval.c
+++ b/eval.c
@@ -7268,6 +7268,10 @@ mnew(klass, obj, id, mklass)
goto again;
}
+ while (rklass != klass &&
+ (FL_TEST(rklass, FL_SINGLETON) || TYPE(rklass) == T_ICLASS)) {
+ rklass = RCLASS(rklass)->super;
+ }
if (TYPE(klass) == T_ICLASS) klass = RBASIC(klass)->klass;
method = Data_Make_Struct(mklass, struct METHOD, bm_mark, free, data);
data->klass = klass;