Title: [282469] trunk/Source/_javascript_Core
Revision
282469
Author
[email protected]
Date
2021-09-15 13:18:25 -0700 (Wed, 15 Sep 2021)

Log Message

Avoid GCC warnings introduced in r282125
https://bugs.webkit.org/show_bug.cgi?id=230154

Patch by Michael Catanzaro <[email protected]> on 2021-09-15
Reviewed by Fujii Hironori.

Yusuke suggested casting to UChar to avoid -Wswitch-out-of-range. This works!

Also, avoid -Wredundant-move by removing one unnecessary WTFMove.

* runtime/ISO8601.cpp:
(JSC::ISO8601::parseTimeZoneBracketedAnnotation):
(JSC::ISO8601::canBeTimeZone):
(JSC::ISO8601::parseTimeZone):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (282468 => 282469)


--- trunk/Source/_javascript_Core/ChangeLog	2021-09-15 20:17:05 UTC (rev 282468)
+++ trunk/Source/_javascript_Core/ChangeLog	2021-09-15 20:18:25 UTC (rev 282469)
@@ -1,3 +1,19 @@
+2021-09-15  Michael Catanzaro  <[email protected]>
+
+        Avoid GCC warnings introduced in r282125
+        https://bugs.webkit.org/show_bug.cgi?id=230154
+
+        Reviewed by Fujii Hironori.
+
+        Yusuke suggested casting to UChar to avoid -Wswitch-out-of-range. This works!
+
+        Also, avoid -Wredundant-move by removing one unnecessary WTFMove.
+
+        * runtime/ISO8601.cpp:
+        (JSC::ISO8601::parseTimeZoneBracketedAnnotation):
+        (JSC::ISO8601::canBeTimeZone):
+        (JSC::ISO8601::parseTimeZone):
+
 2021-09-15  Yusuke Suzuki  <[email protected]>
 
         [JSC] Optimize leaf object creation in JSON.parse

Modified: trunk/Source/_javascript_Core/runtime/ISO8601.cpp (282468 => 282469)


--- trunk/Source/_javascript_Core/runtime/ISO8601.cpp	2021-09-15 20:17:05 UTC (rev 282468)
+++ trunk/Source/_javascript_Core/runtime/ISO8601.cpp	2021-09-15 20:18:25 UTC (rev 282469)
@@ -448,7 +448,7 @@
         return std::nullopt;
     buffer.advance();
 
-    switch (*buffer) {
+    switch (static_cast<UChar>(*buffer)) {
     case '+':
     case '-':
     case minusSign: {
@@ -576,7 +576,7 @@
         if (*buffer != ']')
             return std::nullopt;
         buffer.advance();
-        return WTFMove(result);
+        return result;
     }
     }
 }
@@ -584,7 +584,7 @@
 template<typename CharacterType>
 static bool canBeTimeZone(const StringParsingBuffer<CharacterType>& buffer, CharacterType character)
 {
-    switch (character) {
+    switch (static_cast<UChar>(character)) {
     // UTCDesignator
     // https://tc39.es/proposal-temporal/#prod-UTCDesignator
     case 'z':
@@ -615,7 +615,7 @@
 {
     if (buffer.atEnd())
         return std::nullopt;
-    switch (*buffer) {
+    switch (static_cast<UChar>(*buffer)) {
     // UTCDesignator
     // https://tc39.es/proposal-temporal/#prod-UTCDesignator
     case 'z':
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to