Bug 1448194 - Substract the mBytecodeOffset from the bytecode length, as this could cause some assertion failures. r=mrbkap
authorNicolas B. Pierron <nicolas.b.pierron@gmail.com>
Wed, 04 Apr 2018 15:08:08 +0000
changeset 411995 be6e3454d8dde110a2f5af54efed096ef6f2c661
parent 411994 af78c390b5d2b9d114093836b9c811249211ceda
child 411996 9402bfb8bc8d9b30161d162e0b43ef8d1faec211
push id101823
push usernpierron@mozilla.com
push dateFri, 06 Apr 2018 09:48:28 +0000
treeherdermozilla-inbound@be6e3454d8dd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmrbkap
bugs1448194
milestone61.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 1448194 - Substract the mBytecodeOffset from the bytecode length, as this could cause some assertion failures. r=mrbkap
dom/script/ScriptLoader.cpp
--- a/dom/script/ScriptLoader.cpp
+++ b/dom/script/ScriptLoader.cpp
@@ -1795,17 +1795,18 @@ ScriptLoader::AttemptAsyncScriptCompile(
     return rv;
   }
 
   if (aRequest->IsSource()) {
     if (!JS::CanCompileOffThread(cx, options, aRequest->mScriptText.length())) {
       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;
     }
   }
 
   RefPtr<NotifyOffThreadScriptLoadCompletedRunnable> runnable =
     new NotifyOffThreadScriptLoadCompletedRunnable(aRequest, this);
 
   if (aRequest->IsModuleRequest()) {