bug 910376 - don't risk leaving mSharedBlobData uninitialized. r=karlt
authorJonathan Kew <jkew@mozilla.com>
Wed, 04 Sep 2013 10:01:57 +0100
changeset 145427 f88c529008d024cbb21ed87808ba55b250f3039d
parent 145426 69be1a2ffd39f85f0fad378d86c539e89453ba53
child 145428 1a046ece14db3801ab5ebaa3bb85b196ed3bbae3
push id25213
push userkwierso@gmail.com
push dateWed, 04 Sep 2013 23:18:26 +0000
treeherdermozilla-central@dffedf20a02d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskarlt
bugs910376
milestone26.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 910376 - don't risk leaving mSharedBlobData uninitialized. r=karlt
gfx/thebes/gfxFont.h
--- a/gfx/thebes/gfxFont.h
+++ b/gfx/thebes/gfxFont.h
@@ -599,22 +599,30 @@ private:
     public:
         // Declarations for nsTHashtable
 
         typedef nsUint32HashKey KeyClass;
         typedef KeyClass::KeyType KeyType;
         typedef KeyClass::KeyTypePointer KeyTypePointer;
 
         FontTableHashEntry(KeyTypePointer aTag)
-            : KeyClass(aTag), mBlob() { }
-
+            : KeyClass(aTag)
+            , mSharedBlobData(nullptr)
+            , mBlob(nullptr)
+        { }
+
+        // NOTE: This assumes the new entry belongs to the same hashtable as
+        // the old, because the mHashtable pointer in mSharedBlobData (if
+        // present) will not be updated.
         FontTableHashEntry(FontTableHashEntry&& toMove)
             : KeyClass(mozilla::Move(toMove))
+            , mSharedBlobData(mozilla::Move(toMove.mSharedBlobData))
             , mBlob(mozilla::Move(toMove.mBlob))
         {
+            toMove.mSharedBlobData = nullptr;
             toMove.mBlob = nullptr;
         }
 
         ~FontTableHashEntry() { Clear(); }
 
         // FontTable/Blob API
 
         // Transfer (not copy) elements of aTable to a new hb_blob_t and