ruby-changes:28035
From: nagachika <ko1@a...>
Date: Thu, 4 Apr 2013 02:12:03 +0900 (JST)
Subject: [ruby-changes:28035] nagachika:r40087 (ruby_2_0_0): merge revision(s) 39650: [Backport #8043]
nagachika 2013-04-04 02:11:47 +0900 (Thu, 04 Apr 2013) New Revision: 40087 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=40087 Log: merge revision(s) 39650: [Backport #8043] * marshal.c (w_extended): check for prepended object. [ruby-core:53206] [Bug #8043] Modified directories: branches/ruby_2_0_0/ Modified files: branches/ruby_2_0_0/ChangeLog branches/ruby_2_0_0/marshal.c branches/ruby_2_0_0/test/ruby/marshaltestlib.rb branches/ruby_2_0_0/version.h Index: ruby_2_0_0/ChangeLog =================================================================== --- ruby_2_0_0/ChangeLog (revision 40086) +++ ruby_2_0_0/ChangeLog (revision 40087) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/ChangeLog#L1 +Thu Apr 4 02:11:30 2013 Nobuyoshi Nakada <nobu@r...> + + * marshal.c (w_extended): check for prepended object. + [ruby-core:53206] [Bug #8043] + Wed Mar 27 03:02:30 2013 NARUSE, Yui <naruse@r...> * vm_exec.c: Correct predefined macro name. This typo is introduced by Index: ruby_2_0_0/version.h =================================================================== --- ruby_2_0_0/version.h (revision 40086) +++ ruby_2_0_0/version.h (revision 40087) @@ -1,10 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/version.h#L1 #define RUBY_VERSION "2.0.0" -#define RUBY_RELEASE_DATE "2013-04-03" -#define RUBY_PATCHLEVEL 102 +#define RUBY_RELEASE_DATE "2013-04-04" +#define RUBY_PATCHLEVEL 103 #define RUBY_RELEASE_YEAR 2013 #define RUBY_RELEASE_MONTH 4 -#define RUBY_RELEASE_DAY 3 +#define RUBY_RELEASE_DAY 4 #include "ruby/version.h" Index: ruby_2_0_0/marshal.c =================================================================== --- ruby_2_0_0/marshal.c (revision 40086) +++ ruby_2_0_0/marshal.c (revision 40087) @@ -457,12 +457,17 @@ hash_each(VALUE key, VALUE value, struct https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/marshal.c#L457 return ST_CONTINUE; } +#define SINGLETON_DUMP_UNABLE_P(klass) \ + (RCLASS_M_TBL(klass)->num_entries || \ + (RCLASS_IV_TBL(klass) && RCLASS_IV_TBL(klass)->num_entries > 1)) + static void w_extended(VALUE klass, struct dump_arg *arg, int check) { if (check && FL_TEST(klass, FL_SINGLETON)) { - if (RCLASS_M_TBL(klass)->num_entries || - (RCLASS_IV_TBL(klass) && RCLASS_IV_TBL(klass)->num_entries > 1)) { + VALUE origin = RCLASS_ORIGIN(klass); + if (SINGLETON_DUMP_UNABLE_P(klass) || + (origin != klass && SINGLETON_DUMP_UNABLE_P(origin))) { rb_raise(rb_eTypeError, "singleton can't be dumped"); } klass = RCLASS_SUPER(klass); Index: ruby_2_0_0/test/ruby/marshaltestlib.rb =================================================================== --- ruby_2_0_0/test/ruby/marshaltestlib.rb (revision 40086) +++ ruby_2_0_0/test/ruby/marshaltestlib.rb (revision 40087) @@ -386,6 +386,11 @@ module MarshalTestLib https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/test/ruby/marshaltestlib.rb#L386 o = Object.new def o.m() end assert_raise(TypeError) { marshaltest(o) } + + bug8043 = '[ruby-core:53206] [Bug #8043]' + class << o; prepend Mod1; end + assert_raise(TypeError, bug8043) {marshaltest(o)} + o = Object.new c = class << o @v = 1 Property changes on: ruby_2_0_0 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r39650 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/