Bug 952840, part 2 - Get rid of one goto in XPCNativeSet::GetNewOrUsed. r=bholley
authorAndrew McCreight <continuation@gmail.com>
Mon, 06 Jan 2014 17:32:25 -0800
changeset 162301 64cfe4a6eafa2562623b6d793e75df6c3a24bfb9
parent 162300 2cb3e4d522cc95356636dd9c5fa1ff66c74ab9c5
child 162302 99eb8a370b2107ecdb7ab62a55336ad6582a795e
push idunknown
push userunknown
push dateunknown
reviewersbholley
bugs952840
milestone29.0a1
Bug 952840, part 2 - Get rid of one goto in XPCNativeSet::GetNewOrUsed. r=bholley arr.get() only returns null if the second argument to its constructor is null, but here it is being infallibly allocated.
js/xpconnect/src/XPCWrappedNativeInfo.cpp
--- a/js/xpconnect/src/XPCWrappedNativeInfo.cpp
+++ b/js/xpconnect/src/XPCWrappedNativeInfo.cpp
@@ -474,18 +474,16 @@ XPCNativeSet::GetNewOrUsed(nsIClassInfo*
 
     MOZ_ASSERT((iidCount && iidArray) || !(iidCount || iidArray), "GetInterfaces returned bad array");
 
     // !!! from here on we only exit through the 'out' label !!!
 
     if (iidCount) {
         AutoMarkingNativeInterfacePtrArrayPtr
             arr(cx, new XPCNativeInterface*[iidCount], iidCount, true);
-        if (!arr)
-            goto out;
 
         interfaceArray = arr;
 
         XPCNativeInterface** currentInterface = interfaceArray;
         nsIID**              currentIID = iidArray;
         uint16_t             interfaceCount = 0;
 
         for (uint32_t i = 0; i < iidCount; i++) {