Bug 1037889 - Attempt to silence a harmless Coverity warning. r=bbouvier
authorJan de Mooij <jdemooij@mozilla.com>
Fri, 01 Aug 2014 11:16:46 +0200
changeset 197265 33654f4fe5476ebcce706e4c743292c069dbacda
parent 197264 a2212622a73198ca3bb95bbd29188b4f9e9c2fd6
child 197266 afeb3d37ce5dd425e195e723736821d8ede990d9
push id27236
push useremorley@mozilla.com
push dateFri, 01 Aug 2014 15:52:48 +0000
treeherdermozilla-central@44e5072476b7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbbouvier
bugs1037889
milestone34.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1037889 - Attempt to silence a harmless Coverity warning. r=bbouvier
js/src/jsnum.cpp
--- a/js/src/jsnum.cpp
+++ b/js/src/jsnum.cpp
@@ -1748,19 +1748,20 @@ js_strtod(ThreadSafeContext *cx, const C
     size_t length = end - s;
 
     Vector<char, 32> chars(cx);
     if (!chars.growByUninitialized(length + 1))
         return false;
 
     size_t i = 0;
     for (; i < length; i++) {
-        if (s[i] >> 8)
+        jschar c = s[i];
+        if (c >> 8)
             break;
-        chars[i] = char(s[i]);
+        chars[i] = char(c);
     }
     chars[i] = 0;
 
     /* Try to parse +Infinity, -Infinity or Infinity. */
     {
         char *afterSign = chars.begin();
         bool negative = (*afterSign == '-');
         if (negative || *afterSign == '+')