ruby-changes:34200
From: nagachika <ko1@a...>
Date: Mon, 2 Jun 2014 09:02:06 +0900 (JST)
Subject: [ruby-changes:34200] nagachika:r46301 (ruby_2_1): merge revision(s) r45350: [Backport #9645]
nagachika 2014-06-02 01:55:58 +0900 (Mon, 02 Jun 2014) New Revision: 46301 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=46301 Log: merge revision(s) r45350: [Backport #9645] * variable.c (rb_const_set): delete existing entry on redefinition [Bug #9645] * test/ruby/test_const.rb (test_redefinition): test for leak Modified directories: branches/ruby_2_1/ Modified files: branches/ruby_2_1/ChangeLog branches/ruby_2_1/test/ruby/test_const.rb branches/ruby_2_1/variable.c branches/ruby_2_1/version.h Index: ruby_2_1/ChangeLog =================================================================== --- ruby_2_1/ChangeLog (revision 46300) +++ ruby_2_1/ChangeLog (revision 46301) @@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/ChangeLog#L1 +Mon Jun 2 01:46:43 2014 Eric Wong <e@8...> + + * variable.c (rb_const_set): delete existing entry on redefinition + [Bug #9645] + * test/ruby/test_const.rb (test_redefinition): test for leak + Fri May 30 00:13:19 2014 Nobuyoshi Nakada <nobu@r...> * eval.c (setup_exception): preserve errinfo across calling #to_s Index: ruby_2_1/variable.c =================================================================== --- ruby_2_1/variable.c (revision 46300) +++ ruby_2_1/variable.c (revision 46301) @@ -2203,6 +2203,8 @@ rb_const_set(VALUE klass, ID id, VALUE v https://github.com/ruby/ruby/blob/trunk/ruby_2_1/variable.c#L2203 rb_compile_warn(RSTRING_PTR(ce->file), ce->line, "previous definition of %"PRIsVALUE" was here", name); } + st_delete(RCLASS_CONST_TBL(klass), &id, 0); + xfree(ce); } } } Index: ruby_2_1/version.h =================================================================== --- ruby_2_1/version.h (revision 46300) +++ ruby_2_1/version.h (revision 46301) @@ -1,10 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/version.h#L1 #define RUBY_VERSION "2.1.2" -#define RUBY_RELEASE_DATE "2014-05-30" -#define RUBY_PATCHLEVEL 117 +#define RUBY_RELEASE_DATE "2014-06-02" +#define RUBY_PATCHLEVEL 118 #define RUBY_RELEASE_YEAR 2014 -#define RUBY_RELEASE_MONTH 5 -#define RUBY_RELEASE_DAY 30 +#define RUBY_RELEASE_MONTH 6 +#define RUBY_RELEASE_DAY 2 #include "ruby/version.h" Index: ruby_2_1/test/ruby/test_const.rb =================================================================== --- ruby_2_1/test/ruby/test_const.rb (revision 46300) +++ ruby_2_1/test/ruby/test_const.rb (revision 46301) @@ -1,5 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/test/ruby/test_const.rb#L1 # -*- coding: us-ascii -*- require 'test/unit' +require_relative 'envutil' class TestConst < Test::Unit::TestCase TEST1 = 1 @@ -54,5 +55,12 @@ class TestConst < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/ruby_2_1/test/ruby/test_const.rb#L55 #{__FILE__}:#{__LINE__-1}: warning: already initialized constant #{c}::X #{__FILE__}:#{__LINE__-3}: warning: previous definition of X was here WARNING + code = <<-PRE +olderr = $stderr.dup +$stderr.reopen(File::NULL, "wb") +350000.times { FOO = :BAR } +$stderr.reopen(olderr) +PRE + assert_no_memory_leak([], '', code, 'redefined constant') end end Property changes on: ruby_2_1 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r45350 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/