Bug 1158772 - fix non-idiomatic memset call in nsDeque.cpp; r=erahm
authorNathan Froyd <froydnj@mozilla.com>
Mon, 27 Apr 2015 07:55:32 -0400
changeset 241237 4f898b4ffd633ed3dc2c75cd5e38e8016b2e3ea6
parent 241236 d02374f93b37167b58a34a8f78ee785089027c3c
child 241238 f284c64e55371a5ecbbb86d0790e9ce418767ef8
push id59061
push usernfroyd@mozilla.com
push dateMon, 27 Apr 2015 18:29:45 +0000
treeherdermozilla-inbound@f284c64e5537 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerserahm
bugs1158772
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 1158772 - fix non-idiomatic memset call in nsDeque.cpp; r=erahm Coverty complains that we're using sizeof(mData) here instead of sizeof(*mData). They're equivalent for all the architectures we care about, but go ahead and tidy up the syntax to silence the static analyzer.
xpcom/glue/nsDeque.cpp
--- a/xpcom/glue/nsDeque.cpp
+++ b/xpcom/glue/nsDeque.cpp
@@ -130,17 +130,17 @@ nsDeque::SetDeallocator(nsDequeFunctor* 
 
 /**
  * Remove all items from container without destroying them.
  */
 void
 nsDeque::Empty()
 {
   if (mSize && mData) {
-    memset(mData, 0, mCapacity * sizeof(mData));
+    memset(mData, 0, mCapacity * sizeof(*mData));
   }
   mSize = 0;
   mOrigin = 0;
 }
 
 /**
  * Remove and delete all items from container
  */