Bug 1234177 - check to see if mFunctions.append returned error. r=bholley
authorBogdan Postelnicu <bogdan.postelnicu@softvision.ro>
Thu, 24 Dec 2015 14:14:43 -0500
changeset 277586 f40c0da4e4ced2646c9741d99ca36159a2de13a1
parent 277585 7b60d08cf7c82976d069a642ef2fb9a71ef85b7e
child 277587 f950b7a0474115208980ea6e5abf640e5c9c961b
push id69533
push userkgupta@mozilla.com
push dateThu, 24 Dec 2015 19:19:15 +0000
treeherdermozilla-inbound@f40c0da4e4ce [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbholley
bugs1234177
milestone46.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 1234177 - check to see if mFunctions.append returned error. r=bholley DONTBUILD because this is a backout/reland to fix author info.
js/xpconnect/src/ExportHelpers.cpp
--- a/js/xpconnect/src/ExportHelpers.cpp
+++ b/js/xpconnect/src/ExportHelpers.cpp
@@ -200,17 +200,18 @@ public:
                 return false;
             if (!JS_WriteBytes(aWriter, &idx, sizeof(size_t)))
                 return false;
             return true;
         }
 
         if (JS::IsCallable(aObj)) {
             if (mOptions->cloneFunctions) {
-                mFunctions.append(aObj);
+                if (!mFunctions.append(aObj))
+                    return false;
                 return JS_WriteUint32Pair(aWriter, SCTAG_FUNCTION, mFunctions.length() - 1);
             } else {
                 JS_ReportError(aCx, "Permission denied to pass a Function via structured clone");
                 return false;
             }
         }
 
 #ifdef MOZ_NFC