Bug 921871 - Fix -Wunitialized warning in Vector.h. r=Waldo
authorReuben Morais <reuben.morais@gmail.com>
Thu, 17 Oct 2013 18:29:46 -0300
changeset 166091 9ba162545a939b738d909e31ae3afab10fb5cb76
parent 166090 bc72b42bcf7644385188e115b123fd7a2d345b37
child 166092 533d30be7e6e34e27198fd6f03b2a1e15192d245
push id428
push userbbajaj@mozilla.com
push dateTue, 28 Jan 2014 00:16:25 +0000
treeherdermozilla-release@cd72a7ff3a75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersWaldo
bugs921871
milestone27.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 921871 - Fix -Wunitialized warning in Vector.h. r=Waldo
mfbt/Vector.h
--- a/mfbt/Vector.h
+++ b/mfbt/Vector.h
@@ -561,24 +561,25 @@ class VectorBase : private AllocPolicy
   MOZ_ASSERT(mLength <= mCapacity)
 
 /* Vector Implementation */
 
 template<typename T, size_t N, class AP, class TV>
 MOZ_ALWAYS_INLINE
 VectorBase<T, N, AP, TV>::VectorBase(AP ap)
   : AP(ap),
-    mBegin(static_cast<T*>(storage.addr())),
     mLength(0),
     mCapacity(sInlineCapacity)
 #ifdef DEBUG
   , mReserved(sInlineCapacity),
     entered(false)
 #endif
-{}
+{
+  mBegin = static_cast<T*>(storage.addr());
+}
 
 /* Move constructor. */
 template<typename T, size_t N, class AllocPolicy, class TV>
 MOZ_ALWAYS_INLINE
 VectorBase<T, N, AllocPolicy, TV>::VectorBase(MoveRef<TV> rhs)
   : AllocPolicy(rhs)
 #ifdef DEBUG
     , entered(false)