ruby-changes:26584
From: naruse <ko1@a...>
Date: Fri, 28 Dec 2012 01:46:06 +0900 (JST)
Subject: [ruby-changes:26584] naruse:r38635 (trunk): * variable.c (rb_mod_remove_const): fix segv caused by r38558.
naruse 2012-12-28 01:45:36 +0900 (Fri, 28 Dec 2012) New Revision: 38635 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=38635 Log: * variable.c (rb_mod_remove_const): fix segv caused by r38558. Modified files: trunk/ChangeLog trunk/test/ruby/test_module.rb trunk/variable.c Index: ChangeLog =================================================================== --- ChangeLog (revision 38634) +++ ChangeLog (revision 38635) @@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Thu Dec 27 21:56:56 2012 NARUSE, Yui <naruse@r...> + + * variable.c (rb_mod_remove_const): fix segv caused by r38558. + Tue Dec 28 01:13:48 2012 James Edward Gray II <james@g...> * lib/csv.rb: Added more Hash methods to CSV::Row. Index: variable.c =================================================================== --- variable.c (revision 38634) +++ variable.c (revision 38635) @@ -1919,7 +1919,7 @@ rb_mod_remove_const(VALUE mod, VALUE nam https://github.com/ruby/ruby/blob/trunk/variable.c#L1919 } else { rb_name_error_str(name, "`%"PRIsVALUE"' is not allowed as a constant name", - QUOTE_ID(name)); + QUOTE(name)); } } if (!rb_is_const_id(id)) { Index: test/ruby/test_module.rb =================================================================== --- test/ruby/test_module.rb (revision 38634) +++ test/ruby/test_module.rb (revision 38635) @@ -1591,4 +1591,9 @@ class TestModule < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_module.rb#L1591 end assert_equal("", stderr) end + + def test_remove_const + m = Module.new + assert_raise(NameError){ m.instance_eval { remove_const(:__FOO__) } } + end end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/