Skip to content

Commit

Permalink
merges r28453 and r28454 from trunk into ruby_1_9_2.
Browse files Browse the repository at this point in the history
--
* class.c (rb_mod_init_copy): when class is dup'ed, a metaclass of the
  class should be attached to the dup'ed class, not the original
  class.  [ruby-core:30843] [Bug #3461]
--
* bootstraptest/test_class.rb: add a test for [ruby-core:30843].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@28503 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
yugui committed Jul 1, 2010
1 parent 391fb9e commit 2a43e89
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ChangeLog
@@ -1,3 +1,13 @@
Mon Jun 28 03:12:03 2010 Yusuke Endoh <mame@tsg.ne.jp>

* bootstraptest/test_class.rb: add a test for [ruby-core:30843].

Mon Jun 28 02:43:35 2010 Yusuke Endoh <mame@tsg.ne.jp>

* class.c (rb_mod_init_copy): when class is dup'ed, a metaclass of the
class should be attached to the dup'ed class, not the original
class. [ruby-core:30843] [Bug #3461]

Sat Jun 26 07:59:18 2010 Masaki Suketa <masaki.suketa@nifty.ne.jp>

* test/win32ole/test_win32ole_method.rb (test_offset_vtbl): check
Expand Down
7 changes: 7 additions & 0 deletions bootstraptest/test_class.rb
Expand Up @@ -150,3 +150,10 @@ def self.const_missing *args
Module.new{|m| c = class m::C; name; end}
c
}, '[ruby-dev:38456]'

assert_normal_exit %q{
s = Symbol.dup
class << s
end
s.allocate.to_s
}, '[ruby-core:30843]'
1 change: 1 addition & 0 deletions class.c
Expand Up @@ -146,6 +146,7 @@ rb_mod_init_copy(VALUE clone, VALUE orig)
rb_obj_init_copy(clone, orig);
if (!FL_TEST(CLASS_OF(clone), FL_SINGLETON)) {
RBASIC(clone)->klass = rb_singleton_class_clone(orig);
rb_singleton_class_attached(RBASIC(clone)->klass, (VALUE)clone);
}
RCLASS_SUPER(clone) = RCLASS_SUPER(orig);
if (RCLASS_IV_TBL(orig)) {
Expand Down

0 comments on commit 2a43e89

Please sign in to comment.