Bug 1159306 - explicitly initialize nsBaseHashtableET::mData; r=erahm
authorNathan Froyd <froydnj@mozilla.com>
Tue, 28 Apr 2015 12:12:36 -0400
changeset 241840 f450fec85dd575a60d012afc2e5be65ba8753f19
parent 241839 84acf9f2f583ed3e7cb6036058137d6c1b96bee8
child 241841 05398ebd8197e62566f54a9164442c2bced7e8e1
push id59241
push usernfroyd@mozilla.com
push dateThu, 30 Apr 2015 19:52:29 +0000
treeherdermozilla-inbound@f450fec85dd5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerserahm
bugs1159306
milestone40.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 1159306 - explicitly initialize nsBaseHashtableET::mData; r=erahm mData will get automatically constructed when DataType is a class or struct with a default constructor, but a number of uses of nsBaseHashtable use integer or pointer types as DataType. Explicitly initialize mData so that it looks as though we're fully initializing the class in such cases.
xpcom/glue/nsBaseHashtable.h
--- a/xpcom/glue/nsBaseHashtable.h
+++ b/xpcom/glue/nsBaseHashtable.h
@@ -354,16 +354,17 @@ ImplCycleCollectionTraverse_EnumFunc(K a
 
 //
 // nsBaseHashtableET definitions
 //
 
 template<class KeyClass, class DataType>
 nsBaseHashtableET<KeyClass, DataType>::nsBaseHashtableET(KeyTypePointer aKey)
   : KeyClass(aKey)
+  , mData()
 {
 }
 
 template<class KeyClass, class DataType>
 nsBaseHashtableET<KeyClass, DataType>::nsBaseHashtableET(
       nsBaseHashtableET<KeyClass, DataType>&& aToMove)
   : KeyClass(mozilla::Move(aToMove))
   , mData(mozilla::Move(aToMove.mData))