ruby-changes:20508
From: kosaki <ko1@a...>
Date: Sat, 16 Jul 2011 01:16:43 +0900 (JST)
Subject: [ruby-changes:20508] kosaki:r32556 (ruby_1_9_3): merge revision(s) 32554:
kosaki 2011-07-16 01:16:26 +0900 (Sat, 16 Jul 2011) New Revision: 32556 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=32556 Log: merge revision(s) 32554: * time.c (time_dup): used rb_obj_class() instead of CLASS_OF(). The patch is made by Kazuki Tsujimoto. [Bug #5012] [ruby-dev:44071] * test/ruby/test_time.rb (TestTime#test_getlocal_dont_share_eigenclass): added a new test for eigenclass of time object. Modified files: branches/ruby_1_9_3/ChangeLog branches/ruby_1_9_3/test/ruby/test_time.rb branches/ruby_1_9_3/time.c branches/ruby_1_9_3/version.h Index: ruby_1_9_3/time.c =================================================================== --- ruby_1_9_3/time.c (revision 32555) +++ ruby_1_9_3/time.c (revision 32556) @@ -3430,7 +3430,7 @@ static VALUE time_dup(VALUE time) { - VALUE dup = time_s_alloc(CLASS_OF(time)); + VALUE dup = time_s_alloc(rb_obj_class(time)); time_init_copy(dup, time); return dup; } Index: ruby_1_9_3/ChangeLog =================================================================== --- ruby_1_9_3/ChangeLog (revision 32555) +++ ruby_1_9_3/ChangeLog (revision 32556) @@ -1,3 +1,11 @@ +Sat Jul 16 01:15:53 2011 KOSAKI Motohiro <kosaki.motohiro@g...> + + * time.c (time_dup): used rb_obj_class() instead of CLASS_OF(). + The patch is made by Kazuki Tsujimoto. [Bug #5012] [ruby-dev:44071] + + * test/ruby/test_time.rb (TestTime#test_getlocal_dont_share_eigenclass): + added a new test for eigenclass of time object. + Fri Jul 15 19:11:00 2011 Kenta Murata <mrkn@m...> * bignum.c (bigsub_int): add RB_GC_GUARD. This patch is made by Index: ruby_1_9_3/version.h =================================================================== --- ruby_1_9_3/version.h (revision 32555) +++ ruby_1_9_3/version.h (revision 32556) @@ -1,10 +1,10 @@ #define RUBY_VERSION "1.9.3" #define RUBY_PATCHLEVEL -1 -#define RUBY_RELEASE_DATE "2011-07-15" +#define RUBY_RELEASE_DATE "2011-07-16" #define RUBY_RELEASE_YEAR 2011 #define RUBY_RELEASE_MONTH 7 -#define RUBY_RELEASE_DAY 15 +#define RUBY_RELEASE_DAY 16 #include "ruby/version.h" Index: ruby_1_9_3/test/ruby/test_time.rb =================================================================== --- ruby_1_9_3/test/ruby/test_time.rb (revision 32555) +++ ruby_1_9_3/test/ruby/test_time.rb (revision 32556) @@ -697,4 +697,18 @@ off += 0.1 } end + + def test_getlocal_dont_share_eigenclass + bug5012 = "[ruby-dev:44071]" + + t0 = Time.now + class <<t0; end + t1 = t0.getlocal + + def t0.m + 0 + end + + assert_raise(NoMethodError, bug5012) { t1.m } + end end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/