preprocessor: Fixed a null pointer dereference
This commit is contained in:
parent
666fc82011
commit
a39eaec1cc
|
@ -576,23 +576,26 @@ std::string Preprocessor::expandMacros(std::string code)
|
||||||
const Token *tok = tokenizer.tokens();
|
const Token *tok = tokenizer.tokens();
|
||||||
while (tok && tok->str() != ")")
|
while (tok && tok->str() != ")")
|
||||||
tok = tok->next();
|
tok = tok->next();
|
||||||
while ((tok = tok->next()) != NULL)
|
if (tok)
|
||||||
{
|
{
|
||||||
std::string str = tok->str();
|
while ((tok = tok->next()) != NULL)
|
||||||
if (tok->isName())
|
|
||||||
{
|
{
|
||||||
for (unsigned int i = 0; i < macroparams.size(); ++i)
|
std::string str = tok->str();
|
||||||
|
if (tok->isName())
|
||||||
{
|
{
|
||||||
if (str == macroparams[i])
|
for (unsigned int i = 0; i < macroparams.size(); ++i)
|
||||||
{
|
{
|
||||||
str = params[i];
|
if (str == macroparams[i])
|
||||||
break;
|
{
|
||||||
|
str = params[i];
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
macrocode += str;
|
||||||
|
if (Token::Match(tok, "%type% %var%"))
|
||||||
|
macrocode += " ";
|
||||||
}
|
}
|
||||||
macrocode += str;
|
|
||||||
if (Token::Match(tok, "%type% %var%"))
|
|
||||||
macrocode += " ";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue