Bug 1551509 - Make BinASTTokenReaderBase::{readConst,matchConst} accept char>=0x80. r=Yoric
authorTooru Fujisawa <arai_a@mac.com>
Mon, 20 May 2019 10:40:03 +0000
changeset 474504 b7e30b4bf3f9f3d19abd1b2bfd7dc9d7f7aac1f1
parent 474503 62f8232e95795381a6b8a14b25121f73d9a1877a
child 474505 d68c95ef507de06aec2f53fc776ca8bb54c2e064
push id36041
push userccoroiu@mozilla.com
push dateMon, 20 May 2019 21:55:28 +0000
treeherdermozilla-central@29bdbbe89264 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersYoric
bugs1551509
milestone68.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 1551509 - Make BinASTTokenReaderBase::{readConst,matchConst} accept char>=0x80. r=Yoric Differential Revision: https://phabricator.services.mozilla.com/D31055
js/src/frontend/BinASTTokenReaderBase.h
--- a/js/src/frontend/BinASTTokenReaderBase.h
+++ b/js/src/frontend/BinASTTokenReaderBase.h
@@ -2,16 +2,18 @@
  * vim: set ts=8 sts=2 et sw=2 tw=80:
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef frontend_BinASTTokenReaderBase_h
 #define frontend_BinASTTokenReaderBase_h
 
+#include <string.h>
+
 #include "frontend/BinASTToken.h"
 #include "frontend/ErrorReporter.h"
 #include "frontend/TokenStream.h"
 
 #include "js/Result.h"
 #include "js/TypeDecls.h"
 
 namespace js {
@@ -177,19 +179,18 @@ class MOZ_STACK_CLASS BinASTTokenReaderB
     MOZ_ASSERT(!hasRaisedError());
 
     if (current_ + N - 1 > stop_) {
       return false;
     }
 
 #ifndef FUZZING
     // Perform lookup, without side-effects.
-    if (!std::equal(current_,
-                    current_ + N + (expectNul ? 0 : -1) /*implicit NUL*/,
-                    value)) {
+    if (memcmp(current_, value, N + (expectNul ? 0 : -1) /*implicit NUL*/) !=
+        0) {
       return false;
     }
 #endif
 
     // Looks like we have a match. Now perform side-effects
     current_ += N + (expectNul ? 0 : -1);
     updateLatestKnownGood();
     return true;