Bug 1359980 - Followup hazard fix. (Maybe the varargs threw off the hazard analysis, where the suppress-GC operation occurred *inside* a varargs function? *shrug*) r=bustage
☠☠ backed out by 71f91a6c6e55 ☠ ☠
authorJeff Walden <jwalden@mit.edu>
Fri, 28 Apr 2017 19:35:52 -0700
changeset 355780 21447217ddbd0350120bb26de3d2906afd9970e8
parent 355779 8e48a8ed30e78ef774befe4e617c25ced2c992c5
child 355781 c90fa5a4ce95c2104914450ab7e234b13bb1a0db
push id31740
push userarchaeopteryx@coole-files.de
push dateSat, 29 Apr 2017 19:31:26 +0000
treeherdermozilla-central@2fe636103d71 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbustage
bugs1359980
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 1359980 - Followup hazard fix. (Maybe the varargs threw off the hazard analysis, where the suppress-GC operation occurred *inside* a varargs function? *shrug*) r=bustage
js/src/irregexp/RegExpParser.cpp
js/src/irregexp/RegExpParser.h
--- a/js/src/irregexp/RegExpParser.cpp
+++ b/js/src/irregexp/RegExpParser.cpp
@@ -247,20 +247,18 @@ RegExpParser<CharT>::RegExpParser(fronte
     contains_anchor_(false),
     is_scanned_for_captures_(false)
 {
     Advance();
 }
 
 template <typename CharT>
 void
-RegExpParser<CharT>::SyntaxError(unsigned errorNumber, va_list args)
+RegExpParser<CharT>::SyntaxError(unsigned errorNumber, ...)
 {
-    gc::AutoSuppressGC suppressGC(ts.context());
-
     ErrorMetadata err;
 
     ts.fillExcludingContext(&err, ts.currentToken().pos.begin);
 
     // For most error reporting, the line of context derives from the token
     // stream.  So when location information doesn't come from the token
     // stream, we can't give a line of context.  But here the "line of context"
     // can be (and is) derived from the pattern text, so we can provide it no
@@ -292,30 +290,30 @@ RegExpParser<CharT>::SyntaxError(unsigne
 
     err.lineOfContext.reset(windowBuf.stealChars());
     if (!err.lineOfContext)
         return;
 
     err.lineLength = windowLength;
     err.tokenOffset = offset - (windowStart - start_);
 
+    va_list args;
+    va_start(args, errorNumber);
+
     ReportCompileError(ts.context(), Move(err), nullptr, JSREPORT_ERROR, errorNumber, args);
+
+    va_end(args);
 }
 
 template <typename CharT>
 RegExpTree*
-RegExpParser<CharT>::ReportError(unsigned errorNumber, ...)
+RegExpParser<CharT>::ReportError(unsigned errorNumber, const char* param /* = nullptr */)
 {
-    va_list args;
-    va_start(args, errorNumber);
-
-    SyntaxError(errorNumber, args);
-
-    va_end(args);
-
+    gc::AutoSuppressGC suppressGC(ts.context());
+    SyntaxError(errorNumber, param);
     return nullptr;
 }
 
 template <typename CharT>
 void
 RegExpParser<CharT>::Advance()
 {
     if (next_pos_ < end_) {
--- a/js/src/irregexp/RegExpParser.h
+++ b/js/src/irregexp/RegExpParser.h
@@ -210,20 +210,20 @@ class RegExpParser
     // stores the result in the output parameter and returns true.  If
     // it fails it will push back the characters read so the same characters
     // can be reparsed.
     bool ParseBackReferenceIndex(int* index_out);
 
     bool ParseClassAtom(char16_t* char_class, widechar *value);
 
   private:
-    void SyntaxError(unsigned errorNumber, va_list args);
+    void SyntaxError(unsigned errorNumber, ...);
 
   public:
-    RegExpTree* ReportError(unsigned errorNumber, ...);
+    RegExpTree* ReportError(unsigned errorNumber, const char* param = nullptr);
 
     void Advance();
     void Advance(int dist) {
         next_pos_ += dist - 1;
         Advance();
     }
 
     void Reset(const CharT* pos) {