diff options
author | Gaming4JC <g4jc@hyperbola.info> | 2019-06-09 16:29:42 -0400 |
---|---|---|
committer | Gaming4JC <g4jc@hyperbola.info> | 2019-07-18 22:38:36 -0400 |
commit | dd0057fbf08d56bbcb3c61900ae2cfc8d359080d (patch) | |
tree | a045a73f5e129f148bef265406a84ff229ec28a0 /js | |
parent | fcdc8929f376207be3594f809adda3c65d487101 (diff) | |
download | UXP-dd0057fbf08d56bbcb3c61900ae2cfc8d359080d.tar UXP-dd0057fbf08d56bbcb3c61900ae2cfc8d359080d.tar.gz UXP-dd0057fbf08d56bbcb3c61900ae2cfc8d359080d.tar.lz UXP-dd0057fbf08d56bbcb3c61900ae2cfc8d359080d.tar.xz UXP-dd0057fbf08d56bbcb3c61900ae2cfc8d359080d.zip |
1336783 - Part 3 - Use simpler macro to avoid internal compiler error on SM-tc(H).
Diffstat (limited to 'js')
-rw-r--r-- | js/src/frontend/Parser.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp index 560dc5ec8..82057f62e 100644 --- a/js/src/frontend/Parser.cpp +++ b/js/src/frontend/Parser.cpp @@ -63,24 +63,27 @@ using BindingIter = ParseContext::Scope::BindingIter; using UsedNamePtr = UsedNameTracker::UsedNameMap::Ptr; // Read a token. Report an error and return null() if that token doesn't match -// to the given func's condition. -#define MUST_MATCH_TOKEN_FUNC_MOD(func, modifier, errorNumber) \ +// to the condition. Do not use MUST_MATCH_TOKEN_INTERNAL directly. +#define MUST_MATCH_TOKEN_INTERNAL(cond, modifier, errorNumber) \ JS_BEGIN_MACRO \ TokenKind token; \ if (!tokenStream.getToken(&token, modifier)) \ return null(); \ - if (!(func)(token)) { \ + if (!(cond)) { \ error(errorNumber); \ return null(); \ } \ JS_END_MACRO #define MUST_MATCH_TOKEN_MOD(tt, modifier, errorNumber) \ - MUST_MATCH_TOKEN_FUNC_MOD([](TokenKind tok) { return tok == tt; }, modifier, errorNumber) + MUST_MATCH_TOKEN_INTERNAL(token == tt, modifier, errorNumber) #define MUST_MATCH_TOKEN(tt, errorNumber) \ MUST_MATCH_TOKEN_MOD(tt, TokenStream::None, errorNumber) +#define MUST_MATCH_TOKEN_FUNC_MOD(func, modifier, errorNumber) \ + MUST_MATCH_TOKEN_INTERNAL((func)(token), modifier, errorNumber) + #define MUST_MATCH_TOKEN_FUNC(func, errorNumber) \ MUST_MATCH_TOKEN_FUNC_MOD(func, TokenStream::None, errorNumber) |