ruby-changes:23504
From: naruse <ko1@a...>
Date: Mon, 7 May 2012 11:03:40 +0900 (JST)
Subject: [ruby-changes:23504] naruse:r35555 (trunk): * ext/bigdecimal/bigdecimal.c (Init_bigdecimal): define IDs before
naruse 2012-05-07 11:03:28 +0900 (Mon, 07 May 2012) New Revision: 35555 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=35555 Log: * ext/bigdecimal/bigdecimal.c (Init_bigdecimal): define IDs before they are used. [ruby-core:44900] [Bug #6406] Modified files: trunk/ChangeLog trunk/ext/bigdecimal/bigdecimal.c trunk/test/bigdecimal/test_bigdecimal.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 35554) +++ ChangeLog (revision 35555) @@ -1,3 +1,8 @@ +Mon May 7 10:49:36 2012 NARUSE, Yui <naruse@r...> + + * ext/bigdecimal/bigdecimal.c (Init_bigdecimal): define IDs before + they are used. [ruby-core:44900] [Bug #6406] + Mon May 7 10:27:56 2012 Nobuyoshi Nakada <nobu@r...> * ext/digest/rmd160/rmd160.c (RMD160_Update): fix for huge data. Index: ext/bigdecimal/bigdecimal.c =================================================================== --- ext/bigdecimal/bigdecimal.c (revision 35554) +++ ext/bigdecimal/bigdecimal.c (revision 35555) @@ -2858,6 +2858,10 @@ { VALUE arg; + id_BigDecimal_exception_mode = rb_intern_const("BigDecimal.exception_mode"); + id_BigDecimal_rounding_mode = rb_intern_const("BigDecimal.rounding_mode"); + id_BigDecimal_precision_limit = rb_intern_const("BigDecimal.precision_limit"); + /* Initialize VP routines */ VpInit(0UL); @@ -3053,10 +3057,6 @@ rb_define_singleton_method(rb_mBigMath, "exp", BigMath_s_exp, 2); rb_define_singleton_method(rb_mBigMath, "log", BigMath_s_log, 2); - id_BigDecimal_exception_mode = rb_intern_const("BigDecimal.exception_mode"); - id_BigDecimal_rounding_mode = rb_intern_const("BigDecimal.rounding_mode"); - id_BigDecimal_precision_limit = rb_intern_const("BigDecimal.precision_limit"); - id_up = rb_intern_const("up"); id_down = rb_intern_const("down"); id_truncate = rb_intern_const("truncate"); Index: test/bigdecimal/test_bigdecimal.rb =================================================================== --- test/bigdecimal/test_bigdecimal.rb (revision 35554) +++ test/bigdecimal/test_bigdecimal.rb (revision 35555) @@ -1311,4 +1311,10 @@ code = "exit(BigDecimal.new('10.0') == 10.0.to_d)" assert_ruby_status(%w[-rbigdecimal -rbigdecimal/util -rmathn -], code, bug6093) end + + def test_bug6406 + assert_in_out_err(%w[-rbigdecimal --disable-gems], <<-EOS, [], []) + Thread.current.keys.to_s + EOS + end end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/