bug 1245108 - Fixed uninitialized variables warnings in js/ r=luke
authorPaul Bignier <paul.bignier@gmail.com>
Tue, 12 Feb 2019 18:29:39 +0100
changeset 458717 e8f7092b8d5d
parent 458716 13c2cd492b95
child 458718 aa39bdeb511f
push id35546
push userrmaries@mozilla.com
push dateWed, 13 Feb 2019 04:27:59 +0000
treeherdermozilla-central@636d2c00234d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke
bugs1245108
milestone67.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 1245108 - Fixed uninitialized variables warnings in js/ r=luke
js/src/ctypes/CTypes.cpp
js/src/jsapi-tests/testGCAllocator.cpp
--- a/js/src/ctypes/CTypes.cpp
+++ b/js/src/ctypes/CTypes.cpp
@@ -3236,17 +3236,17 @@ static bool ImplicitConvert(JSContext* c
       }
       *static_cast<bool*>(buffer) = result;
       break;
     }
 #define CHAR16_CASE(name, type, ffiType)                                     \
   case TYPE_##name: {                                                        \
     /* Convert from a 1-character string, regardless of encoding, */         \
     /* or from an integer, provided the result fits in 'type'. */            \
-    type result;                                                             \
+    type result = 0;                                                             \
     if (val.isString()) {                                                    \
       JSString* str = val.toString();                                        \
       if (str->length() != 1)                                                \
         return ConvError(cx, #name, val, convType, funObj, argIndex, arrObj, \
                          arrIndex);                                          \
       JSLinearString* linear = str->ensureLinear(cx);                        \
       if (!linear) return false;                                             \
       result = linear->latin1OrTwoByteChar(0);                               \
--- a/js/src/jsapi-tests/testGCAllocator.cpp
+++ b/js/src/jsapi-tests/testGCAllocator.cpp
@@ -32,17 +32,17 @@ BEGIN_TEST(testGCAllocator) {
   }
 #endif
 
   size_t PageSize = js::gc::SystemPageSize();
 
   /* Finish any ongoing background free activity. */
   js::gc::FinishGC(cx);
 
-  bool growUp;
+  bool growUp = false;
   CHECK(addressesGrowUp(&growUp));
 
   if (growUp) {
     return testGCAllocatorUp(PageSize);
   } else {
     return testGCAllocatorDown(PageSize);
   }
 }