Bug 1369803 - Allow FinishIncrementalEncoding call even if StartIncrementalEncoding call failed. r=shu
authorNicolas B. Pierron <nicolas.b.pierron@mozilla.com>
Tue, 06 Jun 2017 12:24:31 +0000
changeset 410690 fd90d75e1b5111ca178efea29c7e1af7d1bdee4e
parent 410689 11f9875cfe18ecfbb4b28d9f87d5f5af94258430
child 410691 9c6ee0bd191b7ff7195870b0674d4574b2851b9f
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersshu
bugs1369803
milestone55.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 1369803 - Allow FinishIncrementalEncoding call even if StartIncrementalEncoding call failed. r=shu
js/src/jsscript.cpp
--- a/js/src/jsscript.cpp
+++ b/js/src/jsscript.cpp
@@ -2060,17 +2060,19 @@ ScriptSource::xdrEncodeFunction(JSContex
 
     failureCase.release();
     return true;
 }
 
 bool
 ScriptSource::xdrFinalizeEncoder(JS::TranscodeBuffer& buffer)
 {
-    MOZ_ASSERT(hasEncoder());
+    if (!hasEncoder())
+        return false;
+
     auto cleanup = mozilla::MakeScopeExit([&] {
         xdrEncoder_.reset(nullptr);
     });
 
     if (!xdrEncoder_->linearize(buffer))
         return false;
     return true;
 }