Skip to content

Commit

Permalink
* hash.c (rb_hash_become): Hash#become should check added
Browse files Browse the repository at this point in the history
  self-assignment.

* class.c (rb_make_metaclass): metaclass of a superclass may be
  NULL at boot time.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
matz committed Sep 28, 2002
1 parent 5620138 commit 70dc199
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
8 changes: 8 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
Sat Sep 28 10:40:44 2002 Yukihiro Matsumoto <[email protected]>

* hash.c (rb_hash_become): Hash#become should check added
self-assignment.

* class.c (rb_make_metaclass): metaclass of a superclass may be
NULL at boot time.

Sat Sep 28 09:50:03 2002 KONISHI Hiromasa <[email protected]>

* ext/extmk.rb: The condition judgment without necessity was deleted.
Expand Down
7 changes: 6 additions & 1 deletion class.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,12 @@ rb_make_metaclass(obj, super)
RCLASS(klass)->super = RBASIC(rb_class_real(RCLASS(obj)->super))->klass;
}
else {
RBASIC(klass)->klass = RBASIC(rb_class_real(super))->klass;
VALUE metasuper = RBASIC(rb_class_real(super))->klass;

/* metaclass of a superclass may be NULL at boot time */
if (metasuper) {
RBASIC(klass)->klass;
}
}

return klass;
Expand Down
1 change: 1 addition & 0 deletions hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,7 @@ static VALUE
rb_hash_become(hash, hash2)
VALUE hash, hash2;
{
if (hash == hash2) return hash;
hash2 = to_hash(hash2);
rb_hash_clear(hash);
st_foreach(RHASH(hash2)->tbl, replace_i, hash);
Expand Down

0 comments on commit 70dc199

Please sign in to comment.