Bug 1587334 - Remove unused local variable in BinASTTokenReaderContext::readStringPrelude. r=Yoric
authorTooru Fujisawa <arai_a@mac.com>
Fri, 11 Oct 2019 03:48:12 +0000
changeset 497232 acca4b3f8af88f97d415fc5ca8c5af8d4af30ae3
parent 497231 e0b0872d525ee8f647287b1e8c7fcfe4941c2fbf
child 497233 caf9ea85153fc41d1646bdd5900ebba653673dde
push id36679
push userdluca@mozilla.com
push dateFri, 11 Oct 2019 09:30:10 +0000
treeherdermozilla-central@a7ca5ad33f3d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersYoric
bugs1587334
milestone71.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 1587334 - Remove unused local variable in BinASTTokenReaderContext::readStringPrelude. r=Yoric Differential Revision: https://phabricator.services.mozilla.com/D48655
js/src/frontend/BinASTTokenReaderContext.cpp
--- a/js/src/frontend/BinASTTokenReaderContext.cpp
+++ b/js/src/frontend/BinASTTokenReaderContext.cpp
@@ -1155,21 +1155,16 @@ JS::Result<Ok> BinASTTokenReaderContext:
   // Free it if we don't make it out of here alive. Since we don't want to
   // calloc(), we need to avoid marking atoms that might not be there.
   auto se = mozilla::MakeScopeExit([metadata]() { js_free(metadata); });
 
   // Below, we read at most DECODED_BUFFER_SIZE bytes at once and look for
   // strings there. We can overrun to the model part, and in that case put
   // unused part back to `decodedBuffer_`.
 
-  // This buffer holds partially-read string, as Latin1Char.  This doesn't match
-  // to the actual encoding of the strings that is WTF-8, but the validation
-  // should be done later by `AtomizeWTF8Chars`, not immediately.
-  StringBuffer buf(cx_);
-
   RootedAtom atom(cx_);
 
   for (uint32_t stringIndex = 0; stringIndex < stringsNumberOfEntries;
        stringIndex++) {
     if (MOZ_UNLIKELY(current_ >= stop_)) {
       return raiseError("End of file reached while reading strings table");
     }
 
@@ -1192,17 +1187,16 @@ JS::Result<Ok> BinASTTokenReaderContext:
     // +1 for skipping 0x00.
     current_ = end + 1;
   }
 
   // Found all strings. The remaining data is kept in buffer and will be
   // used for later read.
 
   MOZ_ASSERT(!metadata_);
-  MOZ_ASSERT(buf.empty());
   se.release();
   metadata_ = metadata;
   metadataOwned_ = MetadataOwnership::Owned;
 
   return Ok();
 }
 
 JS::Result<Ok> BinASTTokenReaderContext::readHuffmanPrelude() {