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

ruby-changes:42138

From: nobu <ko1@a...>
Date: Mon, 21 Mar 2016 22:09:33 +0900 (JST)
Subject: [ruby-changes:42138] nobu:r54212 (trunk): internal.h: fix no-DLONG case

nobu	2016-03-21 22:09:26 +0900 (Mon, 21 Mar 2016)

  New Revision: 54212

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=54212

  Log:
    internal.h: fix no-DLONG case
    
    * internal.h (rb_fix_mul_fix): multiply converted values, not
      object VALUEs.

  Modified files:
    trunk/ChangeLog
    trunk/internal.h
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 54211)
+++ ChangeLog	(revision 54212)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Mon Mar 21 22:09:24 2016  Nobuyoshi Nakada  <nobu@r...>
+
+	* internal.h (rb_fix_mul_fix): multiply converted values, not
+	  object VALUEs.
+
 Mon Mar 21 20:18:29 2016  Nobuyoshi Nakada  <nobu@r...>
 
 	* common.mk (TEST_EXCLUDES, EXCLUDE_TESTFRAMEWORK): use full spell
Index: internal.h
===================================================================
--- internal.h	(revision 54211)
+++ internal.h	(revision 54212)
@@ -284,11 +284,11 @@ rb_fix_mul_fix(VALUE x, VALUE y) https://github.com/ruby/ruby/blob/trunk/internal.h#L284
 #ifdef DLONG
     return DL2NUM((DLONG)lx * (DLONG)ly);
 #else
-    if (MUL_OVERFLOW_FIXNUM_P(x, y)) {
-	return rb_big_mul(rb_int2big(x), rb_int2big(y));
+    if (MUL_OVERFLOW_FIXNUM_P(lx, ly)) {
+	return rb_big_mul(rb_int2big(lx), rb_int2big(ly));
     }
     else {
-	return LONG2FIX(x * y);
+	return LONG2FIX(lx * ly);
     }
 #endif
 }

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

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