diff --git a/lib/preprocessor.cpp b/lib/preprocessor.cpp index c2cf00017..446836149 100644 --- a/lib/preprocessor.cpp +++ b/lib/preprocessor.cpp @@ -993,7 +993,7 @@ std::string Preprocessor::getdef(std::string line, bool def) } /** Simplify variable in variable map. */ -static void simplifyVarMapExpandValue(Token *tok, const std::map &variables, std::set seenVariables) +static void simplifyVarMapExpandValue(Token *tok, const std::map &variables, std::set &seenVariables) { // TODO: handle function-macros too. @@ -1033,12 +1033,13 @@ static void simplifyVarMapExpandValue(Token *tok, const std::map &variables) { for (std::map::iterator i = variables.begin(); i != variables.end(); ++i) { + std::set seenVariables; + TokenList tokenList(NULL); std::istringstream istr(i->second); if (tokenList.createTokens(istr)) { for (Token *tok = tokenList.front(); tok; tok = tok->next()) { if (tok->isName()) { - std::set seenVariables; simplifyVarMapExpandValue(tok, variables, seenVariables); } } @@ -1937,6 +1938,12 @@ std::string Preprocessor::handleIncludes(const std::string &code, const std::str std::set undefs = _settings ? _settings->userUndefs : std::set(); + if (_errorLogger) + _errorLogger->reportProgress(filePath, "Preprocessor (handleIncludes)", 0); + + if (_settings && _settings->terminated()) + return ""; + std::ostringstream ostr; std::istringstream istr(code); std::string line;