Bug 1156977 - Assert when aClassName is empty in BloatEntry. r=froydnj
authorAndrew McCreight <continuation@gmail.com>
Wed, 22 Apr 2015 08:56:30 -0700
changeset 240558 863f3575521b9ba477368ca7b79becb61b49b57b
parent 240557 71fb4e200c7bfed281a7226296d6de69f4e2224e
child 240559 11df38318e9c069e8f68c997790bbf2c0f13e4fb
push id28636
push userkwierso@gmail.com
push dateThu, 23 Apr 2015 00:16:12 +0000
treeherdermozilla-central@a5af73b32ac8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1156977
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 1156977 - Assert when aClassName is empty in BloatEntry. r=froydnj
xpcom/base/nsTraceRefcnt.cpp
--- a/xpcom/base/nsTraceRefcnt.cpp
+++ b/xpcom/base/nsTraceRefcnt.cpp
@@ -242,16 +242,17 @@ mozilla::StaticAutoPtr<WalkTheStackCodeA
 ////////////////////////////////////////////////////////////////////////////////
 
 class BloatEntry
 {
 public:
   BloatEntry(const char* aClassName, uint32_t aClassSize)
     : mClassSize(aClassSize)
   {
+    NS_ASSERTION(strlen(aClassName) > 0, "BloatEntry name must be non-empty");
     mClassName = PL_strdup(aClassName);
     Clear(&mNewStats);
     Clear(&mAllStats);
     mTotalLeaked = 0;
   }
 
   ~BloatEntry()
   {