Bug 1357865 - Correctly zero the size of an InternalAttr in nsAttrAndChildArray::AddAttrSlot r=bz
authorKirk Steuber <ksteuber@mozilla.com>
Wed, 19 Apr 2017 11:34:02 -0700
changeset 354064 b31ecedca670b2f54948dc1800a97e3daea7d282
parent 354063 9daa571ddc280a10960201f7c37b3472d6e1526a
child 354065 99e4ae9eb731c3098a139e4d3c5d37cab0303c4e
push id31685
push userkwierso@gmail.com
push dateThu, 20 Apr 2017 21:45:29 +0000
treeherdermozilla-central@5e3dc7e1288a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs1357865
milestone55.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 1357865 - Correctly zero the size of an InternalAttr in nsAttrAndChildArray::AddAttrSlot r=bz MozReview-Commit-ID: Csd4MO3fGpN
dom/base/nsAttrAndChildArray.cpp
--- a/dom/base/nsAttrAndChildArray.cpp
+++ b/dom/base/nsAttrAndChildArray.cpp
@@ -875,18 +875,17 @@ nsAttrAndChildArray::AddAttrSlot()
   void** offset = mImpl->mBuffer + slotCount * ATTRSIZE;
 
   if (childCount > 0) {
     memmove(&ATTRS(mImpl)[slotCount + 1], &ATTRS(mImpl)[slotCount],
             childCount * sizeof(nsIContent*));
   }
 
   SetAttrSlotCount(slotCount + 1);
-  offset[0] = nullptr;
-  offset[1] = nullptr;
+  memset(static_cast<void*>(offset), 0, sizeof(InternalAttr));
 
   return true;
 }
 
 inline void
 nsAttrAndChildArray::SetChildAtPos(void** aPos, nsIContent* aChild,
                                    uint32_t aIndex, uint32_t aChildCount)
 {