From 40bbc14054b80bc045ebfbaffe4055b1c007059c Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Fri, 12 May 2017 15:46:34 -0700 Subject: [PATCH] Bug 1361900: Follow-up: Fix order of execution issue. r=me MozReview-Commit-ID: DcmTlzxskUj --- js/xpconnect/loader/ScriptPreloader.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/xpconnect/loader/ScriptPreloader.cpp b/js/xpconnect/loader/ScriptPreloader.cpp index 896c0f784e13..17f3508f8e98 100644 --- a/js/xpconnect/loader/ScriptPreloader.cpp +++ b/js/xpconnect/loader/ScriptPreloader.cpp @@ -446,6 +446,7 @@ ScriptPreloader::InitCacheInternal() size_t offset = 0; while (!buf.finished()) { auto script = MakeUnique(*this, buf); + MOZ_RELEASE_ASSERT(script); auto scriptData = data + script->mOffset; if (scriptData + script->mSize > end) { @@ -461,7 +462,8 @@ ScriptPreloader::InitCacheInternal() script->mXDRRange.emplace(scriptData, scriptData + script->mSize); - mScripts.Put(script->mCachePath, script.release()); + mScripts.Put(script->mCachePath, script.get()); + Unused << script.release(); } if (buf.error()) {