Bug 1411027 - avoid using memset on a not-trivial type like nsTabSizes. r=froydnj
authorAndi-Bogdan Postelnicu <bpostelnicu@mozilla.com>
Tue, 24 Oct 2017 12:47:35 +0300
changeset 387919 50877116db1a
parent 387918 256a887feb92
child 387920 a08737444fc3
push id53934
push usernfroyd@mozilla.com
push date2017-10-24 13:56 +0000
treeherderautoland@50877116db1a [default view] [failures only]
reviewersfroydnj
bugs1411027
milestone58.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 1411027 - avoid using memset on a not-trivial type like nsTabSizes. r=froydnj MozReview-Commit-ID: 7bFwF4fs4gj
dom/base/nsWindowSizes.h
--- a/dom/base/nsWindowSizes.h
+++ b/dom/base/nsWindowSizes.h
@@ -14,17 +14,22 @@
 class nsTabSizes {
 public:
   enum Kind {
       DOM,        // DOM stuff.
       Style,      // Style stuff.
       Other       // Everything else.
   };
 
-  nsTabSizes() { mozilla::PodZero(this); }
+  nsTabSizes()
+    : mDom(0)
+    , mStyle(0)
+    , mOther(0)
+  {
+  }
 
   void add(Kind kind, size_t n)
   {
     switch (kind) {
       case DOM:   mDom   += n; break;
       case Style: mStyle += n; break;
       case Other: mOther += n; break;
       default:    MOZ_CRASH("bad nsTabSizes kind");