Bug 1448194 - Substract the mBytecodeOffset from the bytecode length, as this could cause some assertion failures. r=mrbkap

This commit is contained in:
Nicolas B. Pierron 2018-04-04 15:08:08 +00:00
parent 563ac19f69
commit d8df648fc6

View File

@ -1800,7 +1800,8 @@ ScriptLoader::AttemptAsyncScriptCompile(ScriptLoadRequest* aRequest)
return NS_ERROR_FAILURE;
}
} else {
if (!JS::CanDecodeOffThread(cx, options, aRequest->mScriptBytecode.length())) {
size_t length = aRequest->mScriptBytecode.length() - aRequest->mBytecodeOffset;
if (!JS::CanDecodeOffThread(cx, options, length)) {
return NS_ERROR_FAILURE;
}
}