diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-04-10 08:47:46 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-04-10 08:47:46 +0000 |
commit | daadb8bd53c9a0038fe7f51652b72aaa9b93a220 (patch) | |
tree | e26b224da6f99cc1806e4288a6a4946f269a9a2e /class.c | |
parent | 34159dac1c819b95d2e6a56f24350a83b8217e54 (diff) |
* variable.c (rb_obj_remove_instance_variable): raise NameError if
specified instance variable is not defined.
* variable.c (generic_ivar_remove): modified to check ivar
existence.
* class.c (rb_singleton_class): wrong condition; was creating
unnecessary singleton class.
* numeric.c (int_step): step may be a float less than 1.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@2349 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'class.c')
-rw-r--r-- | class.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -626,7 +626,9 @@ rb_singleton_class(obj) } DEFER_INTS; - if (FL_TEST(RBASIC(obj)->klass, FL_SINGLETON)) { + if (FL_TEST(RBASIC(obj)->klass, FL_SINGLETON) && + ((BUILTIN_TYPE(obj) != T_CLASS && BUILTIN_TYPE(obj) != T_MODULE) || + rb_iv_get(RBASIC(obj)->klass, "__attached__") == obj)) { klass = RBASIC(obj)->klass; } else { |