зеркало из https://github.com/mozilla/gecko-dev.git
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
This commit is contained in:
Родитель
d504bfc0fb
Коммит
9a87fb6fae
|
@ -252,10 +252,8 @@ RegExpParser<CharT>::RegExpParser(frontend::TokenStream& ts, LifoAlloc* alloc,
|
|||
|
||||
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);
|
||||
|
@ -297,20 +295,20 @@ RegExpParser<CharT>::SyntaxError(unsigned errorNumber, va_list args)
|
|||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -215,10 +215,10 @@ class RegExpParser
|
|||
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) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче