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 165139 9ba162545a939b738d909e31ae3afab10fb5cb76
parent 165138 bc72b42bcf7644385188e115b123fd7a2d345b37
child 165140 533d30be7e6e34e27198fd6f03b2a1e15192d245
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [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)