Title: [119205] trunk/Source
Revision
119205
Author
[email protected]
Date
2012-06-01 02:40:36 -0700 (Fri, 01 Jun 2012)

Log Message

[Platform][Decimal] UInt128::operator/= calls makeUInt128 with wrong argument order
https://bugs.webkit.org/show_bug.cgi?id=88044

Reviewed by Kent Tamura.

Source/WebCore:

This patch fixed wrong argument of makeUInt128 in UInt128::operator/= to get right
result for decimal multiplication.

Test: WebKit/chromium/tests/DecimalTest.cpp: Add new a new test case.

* platform/Decimal.cpp:
(WebCore::DecimalPrivate::UInt128::operator/=):

Source/WebKit/chromium:

* tests/DecimalTest.cpp:
(TEST_F): Add a new test for multiplication.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (119204 => 119205)


--- trunk/Source/WebCore/ChangeLog	2012-06-01 09:26:27 UTC (rev 119204)
+++ trunk/Source/WebCore/ChangeLog	2012-06-01 09:40:36 UTC (rev 119205)
@@ -1,3 +1,18 @@
+2012-06-01  Yoshifumi Inoue  <[email protected]>
+
+        [Platform][Decimal] UInt128::operator/= calls makeUInt128 with wrong argument order
+        https://bugs.webkit.org/show_bug.cgi?id=88044
+
+        Reviewed by Kent Tamura.
+
+        This patch fixed wrong argument of makeUInt128 in UInt128::operator/= to get right
+        result for decimal multiplication.
+
+        Test: WebKit/chromium/tests/DecimalTest.cpp: Add new a new test case.
+
+        * platform/Decimal.cpp:
+        (WebCore::DecimalPrivate::UInt128::operator/=):
+
 2012-06-01  Adam Barth  <[email protected]>
 
         sandbox directive in X-WebKit-CSP header unable to create a unique origin

Modified: trunk/Source/WebCore/platform/Decimal.cpp (119204 => 119205)


--- trunk/Source/WebCore/platform/Decimal.cpp	2012-06-01 09:26:27 UTC (rev 119204)
+++ trunk/Source/WebCore/platform/Decimal.cpp	2012-06-01 09:40:36 UTC (rev 119205)
@@ -168,7 +168,7 @@
     uint32_t quotient[4];
     uint32_t remainder = 0;
     for (int i = 3; i >= 0; --i) {
-        const uint64_t work = makeUInt64(remainder, dividend[i]);
+        const uint64_t work = makeUInt64(dividend[i], remainder);
         remainder = static_cast<uint32_t>(work % divisor);
         quotient[i] = static_cast<uint32_t>(work / divisor);
     }

Modified: trunk/Source/WebKit/chromium/ChangeLog (119204 => 119205)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-06-01 09:26:27 UTC (rev 119204)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-06-01 09:40:36 UTC (rev 119205)
@@ -1,3 +1,13 @@
+2012-06-01  Yoshifumi Inoue  <[email protected]>
+
+        [Platform][Decimal] UInt128::operator/= calls makeUInt128 with wrong argument order
+        https://bugs.webkit.org/show_bug.cgi?id=88044
+
+        Reviewed by Kent Tamura.
+
+        * tests/DecimalTest.cpp:
+        (TEST_F): Add a new test for multiplication.
+
 2012-05-31  Hajime Morrita  <[email protected]>
 
         REGRESSION(r117572): editing/spelling/spellcheck-async-remove-frame.html crashes on Mac

Modified: trunk/Source/WebKit/chromium/tests/DecimalTest.cpp (119204 => 119205)


--- trunk/Source/WebKit/chromium/tests/DecimalTest.cpp	2012-06-01 09:26:27 UTC (rev 119204)
+++ trunk/Source/WebKit/chromium/tests/DecimalTest.cpp	2012-06-01 09:40:36 UTC (rev 119205)
@@ -646,6 +646,7 @@
     EXPECT_EQ(encode(2, 0, Negative), Decimal(-1) * Decimal(2));
     EXPECT_EQ(encode(99, 0, Positive), Decimal(99) * Decimal(1));
     EXPECT_EQ(encode(2500, 0, Positive), Decimal(-50) * Decimal(-50));
+    EXPECT_EQ(encode(1, 21, Positive), encode(UINT64_C(10000000000), 0, Positive) * encode(UINT64_C(100000000000), 0, Positive));
 }
 
 TEST_F(DecimalTest, MultiplicationBigExponent)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to