Bug 1361900: Fix one last merge botch, and fix a false rooting hazard warning.

MozReview-Commit-ID: JpKYYEBpbQj
This commit is contained in:
Kris Maglione
2017-05-12 18:14:12 -07:00
parent 48a6c63cf8
commit 5ed1d1edcb
3 changed files with 9 additions and 4 deletions

View File

@@ -433,6 +433,8 @@ ScriptPreloader::InitCacheInternal()
return Err(NS_ERROR_UNEXPECTED);
}
AutoTArray<CachedScript*, 256> scripts;
{
auto cleanup = MakeScopeExit([&] () {
mScripts.Clear();
@@ -462,6 +464,7 @@ ScriptPreloader::InitCacheInternal()
script->mXDRRange.emplace(scriptData, scriptData + script->mSize);
scripts.AppendElement(script.get());
mScripts.Put(script->mCachePath, script.get());
Unused << script.release();
}
@@ -482,7 +485,7 @@ ScriptPreloader::InitCacheInternal()
JS::CompileOptions options(cx, JSVERSION_LATEST);
for (auto& script : IterHash(mScripts, Match<ScriptStatus::Restored>())) {
for (auto& script : scripts) {
// Only async decode scripts which have been used in this process type.
if (script->mProcessTypes.contains(CurrentProcessType()) &&
script->AsyncDecodable() &&