summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-01-12 09:27:48 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-01-12 09:27:48 +0000
commit0d7451ba821b52a51fb6d2cd99cd916225fe4fb5 (patch)
treefe9593d95f118f5483fc7e79a05f389d3ee1a8fc
parent24d0a22505881423444227246e6f81faaba55298 (diff)
* eval.c (rb_define_alloc_func, rb_undef_alloc_func): should
define/undef on a signleton class. [ruby-core:09959] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@15005 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog7
-rw-r--r--eval.c5
2 files changed, 10 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index ff7e79505f..649a2a1f5d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Sat Jan 12 18:27:41 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * eval.c (rb_define_alloc_func, rb_undef_alloc_func): should
+ define/undef on a signleton class. [ruby-core:09959]
+
+9959]
+
Sat Jan 12 12:04:14 2008 Tadayoshi Funaba <tadf@dotrb.org>
* lib/date.rb, lib/date/format.rb: tuning for performance.
diff --git a/eval.c b/eval.c
index 3391849c38..cc965f2a12 100644
--- a/eval.c
+++ b/eval.c
@@ -453,7 +453,8 @@ rb_define_alloc_func(klass, func)
VALUE (*func) _((VALUE));
{
Check_Type(klass, T_CLASS);
- rb_add_method(CLASS_OF(klass), ID_ALLOCATOR, NEW_CFUNC(func, 0), NOEX_PRIVATE);
+ rb_add_method(rb_singleton_class(klass), ID_ALLOCATOR, NEW_CFUNC(func, 0),
+ NOEX_PRIVATE);
}
void
@@ -461,7 +462,7 @@ rb_undef_alloc_func(klass)
VALUE klass;
{
Check_Type(klass, T_CLASS);
- rb_add_method(CLASS_OF(klass), ID_ALLOCATOR, 0, NOEX_UNDEF);
+ rb_add_method(rb_singleton_class(klass), ID_ALLOCATOR, 0, NOEX_UNDEF);
}
static NODE*