Bug 1089370 - Don't null-check a reference in nsContentUtils::CreateContextualFragment; r=jst
authorMs2ger <ms2ger@gmail.com>
Mon, 27 Oct 2014 08:53:54 +0100
changeset 212418 7e8eda44373ce1ec70903ee9a0c4f234e3817837
parent 212417 3c1508886d3288eb8f3473d410284730c0c83794
child 212419 14c6cf6337ccf8016bc0392c7200193056d544cc
push id27710
push usercbook@mozilla.com
push dateMon, 27 Oct 2014 14:52:01 +0000
treeherdermozilla-central@d65d20dc0ac2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjst
bugs1089370
milestone36.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 1089370 - Don't null-check a reference in nsContentUtils::CreateContextualFragment; r=jst This triggers an undefined-bool-conversion warning in recent LLVM. The dereference is safe because nsAutoTArray is infallible.
dom/base/nsContentUtils.cpp
--- a/dom/base/nsContentUtils.cpp
+++ b/dom/base/nsContentUtils.cpp
@@ -4136,21 +4136,16 @@ nsContentUtils::CreateContextualFragment
   nsAutoString uriStr, nameStr;
   nsCOMPtr<nsIContent> content = do_QueryInterface(aContextNode);
   // just in case we have a text node
   if (content && !content->IsElement())
     content = content->GetParent();
 
   while (content && content->IsElement()) {
     nsString& tagName = *tagStack.AppendElement();
-    if (!&tagName) {
-      aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
-      return nullptr;
-    }
-
     tagName = content->NodeInfo()->QualifiedName();
 
     // see if we need to add xmlns declarations
     uint32_t count = content->GetAttrCount();
     bool setDefaultNamespace = false;
     if (count > 0) {
       uint32_t index;