Title: [248043] trunk/Source/WTF
Revision
248043
Author
[email protected]
Date
2019-07-31 09:13:33 -0700 (Wed, 31 Jul 2019)

Log Message

Fix 64-bit vs 32-bit mismatch in LogArgument
https://bugs.webkit.org/show_bug.cgi?id=200286
<rdar://problem/53733671>

Reviewed by Darin Adler.

LogArgument is a utility for converting scalars into strings. It has a
number of versions of a toString() method that is specialized for each
type and converts the value to a string in a manner appropriate for
that type. However, the versions of toString() for "long long" and
"unsigned long long" are actually declared to take an "long" or
"unsigned long" as a parameter. This difference leads to a 64-bit vs
32-bit build error on 32-bit systems. Fix this by specifying
correct/matching types.

* wtf/Logger.h:
(WTF::LogArgument::toString):

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (248042 => 248043)


--- trunk/Source/WTF/ChangeLog	2019-07-31 15:12:41 UTC (rev 248042)
+++ trunk/Source/WTF/ChangeLog	2019-07-31 16:13:33 UTC (rev 248043)
@@ -1,3 +1,23 @@
+2019-07-31  Keith Rollin  <[email protected]>
+
+        Fix 64-bit vs 32-bit mismatch in LogArgument
+        https://bugs.webkit.org/show_bug.cgi?id=200286
+        <rdar://problem/53733671>
+
+        Reviewed by Darin Adler.
+
+        LogArgument is a utility for converting scalars into strings. It has a
+        number of versions of a toString() method that is specialized for each
+        type and converts the value to a string in a manner appropriate for
+        that type. However, the versions of toString() for "long long" and
+        "unsigned long long" are actually declared to take an "long" or
+        "unsigned long" as a parameter. This difference leads to a 64-bit vs
+        32-bit build error on 32-bit systems. Fix this by specifying
+        correct/matching types.
+
+        * wtf/Logger.h:
+        (WTF::LogArgument::toString):
+
 2019-07-30  Myles C. Maxfield  <[email protected]>
 
         REGRESSION(r241288): Text on Yahoo Japan mobile looks too bold

Modified: trunk/Source/WTF/wtf/Logger.h (248042 => 248043)


--- trunk/Source/WTF/wtf/Logger.h	2019-07-31 15:12:41 UTC (rev 248042)
+++ trunk/Source/WTF/wtf/Logger.h	2019-07-31 16:13:33 UTC (rev 248043)
@@ -36,8 +36,8 @@
     template<typename U = T> static typename std::enable_if<std::is_same<U, unsigned>::value, String>::type toString(unsigned argument) { return String::number(argument); }
     template<typename U = T> static typename std::enable_if<std::is_same<U, unsigned long>::value, String>::type toString(unsigned long argument) { return String::number(argument); }
     template<typename U = T> static typename std::enable_if<std::is_same<U, long>::value, String>::type toString(long argument) { return String::number(argument); }
-    template<typename U = T> static typename std::enable_if<std::is_same<U, unsigned long long>::value, String>::type toString(unsigned long argument) { return String::number(argument); }
-    template<typename U = T> static typename std::enable_if<std::is_same<U, long long>::value, String>::type toString(long argument) { return String::number(argument); }
+    template<typename U = T> static typename std::enable_if<std::is_same<U, unsigned long long>::value, String>::type toString(unsigned long long argument) { return String::number(argument); }
+    template<typename U = T> static typename std::enable_if<std::is_same<U, long long>::value, String>::type toString(long long argument) { return String::number(argument); }
     template<typename U = T> static typename std::enable_if<std::is_enum<U>::value, String>::type toString(U argument) { return String::number(static_cast<typename std::underlying_type<U>::type>(argument)); }
     template<typename U = T> static typename std::enable_if<std::is_same<U, float>::value, String>::type toString(float argument) { return String::numberToStringFixedPrecision(argument); }
     template<typename U = T> static typename std::enable_if<std::is_same<U, double>::value, String>::type toString(double argument) { return String::numberToStringFixedPrecision(argument); }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to