[前][次][番号順一覧][スレッド一覧]

ruby-changes:22782

From: nobu <ko1@a...>
Date: Mon, 27 Feb 2012 17:26:01 +0900 (JST)
Subject: [ruby-changes:22782] nobu:r34831 (ruby_1_9_3): merge revision(s) 34829:

nobu	2012-02-27 17:25:46 +0900 (Mon, 27 Feb 2012)

  New Revision: 34831

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=34831

  Log:
    merge revision(s) 34829:
    
    * ext/bigdecimal/bigdecimal.c (GetVpValueWithPrec): since methods
      can be overridden, so should not make an assumption on the type
      of results.  [ruby-core:42969][Bug #6093]

  Modified files:
    branches/ruby_1_9_3/ChangeLog
    branches/ruby_1_9_3/ext/bigdecimal/bigdecimal.c
    branches/ruby_1_9_3/test/bigdecimal/test_bigdecimal.rb
    branches/ruby_1_9_3/version.h

Index: ruby_1_9_3/ChangeLog
===================================================================
--- ruby_1_9_3/ChangeLog	(revision 34830)
+++ ruby_1_9_3/ChangeLog	(revision 34831)
@@ -1,3 +1,9 @@
+Mon Feb 27 17:25:40 2012  Nobuyoshi Nakada  <nobu@r...>
+
+	* ext/bigdecimal/bigdecimal.c (GetVpValueWithPrec): since methods
+	  can be overridden, so should not make an assumption on the type
+	  of results.  [ruby-core:42969][Bug #6093]
+
 Mon Feb 27 02:28:17 2012  NARUSE, Yui  <naruse@r...>
 
 	* regparse.c (add_code_range_to_buf0): wrong condition of duplicated
Index: ruby_1_9_3/ext/bigdecimal/bigdecimal.c
===================================================================
--- ruby_1_9_3/ext/bigdecimal/bigdecimal.c	(revision 34830)
+++ ruby_1_9_3/ext/bigdecimal/bigdecimal.c	(revision 34831)
@@ -210,7 +210,7 @@
 	if (prec < 0) goto unable_to_coerce_without_prec;
 	if (prec > DBL_DIG+1)goto SomeOneMayDoIt;
 	v = rb_funcall(v, id_to_r, 0);
-	/* fall through */
+	goto again;
       case T_RATIONAL:
 	if (prec < 0) goto unable_to_coerce_without_prec;
 
Index: ruby_1_9_3/version.h
===================================================================
--- ruby_1_9_3/version.h	(revision 34830)
+++ ruby_1_9_3/version.h	(revision 34831)
@@ -1,5 +1,5 @@
 #define RUBY_VERSION "1.9.3"
-#define RUBY_PATCHLEVEL 151
+#define RUBY_PATCHLEVEL 152
 
 #define RUBY_RELEASE_DATE "2012-02-27"
 #define RUBY_RELEASE_YEAR 2012
Index: ruby_1_9_3/test/bigdecimal/test_bigdecimal.rb
===================================================================
--- ruby_1_9_3/test/bigdecimal/test_bigdecimal.rb	(revision 34830)
+++ ruby_1_9_3/test/bigdecimal/test_bigdecimal.rb	(revision 34831)
@@ -1,4 +1,5 @@
 require_relative "testbase"
+require_relative "../ruby/envutil"
 
 require 'thread'
 
@@ -1284,4 +1285,16 @@
       end
     end
   end
+
+  def test_to_d
+    bug6093 = '[ruby-core:42969]'
+    code = "exit(BigDecimal.new('10.0') == 10.0.to_d)"
+    assert_ruby_status(%w[-rbigdecimal -rbigdecimal/util -rmathn -], code, bug6093)
+  end
+
+  def test_to_d
+    bug6093 = '[ruby-core:42969]'
+    code = "exit(BigDecimal.new('10.0') == 10.0.to_d)"
+    assert_ruby_status(%w[-rbigdecimal -rbigdecimal/util -rmathn -], code, bug6093)
+  end
 end

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]