Fixed #1325 (Segmentation fault in simplifyTypedef due to bad preprocessing)

This commit is contained in:
Robert Reif 2010-01-29 16:00:48 +01:00 committed by Daniel Marjamäki
parent fc54ed1eef
commit 19bb2940cc
2 changed files with 8 additions and 1 deletions

View File

@ -1626,7 +1626,8 @@ public:
} }
optcomma = false; optcomma = false;
macrocode += str; macrocode += str;
if (Token::Match(tok, "%var% %var%")) if (Token::Match(tok, "%var% %var%") ||
Token::Match(tok, "> >"))
macrocode += " "; macrocode += " ";
} }
} }

View File

@ -501,6 +501,12 @@ void Tokenizer::simplifyTypedef()
while (end && end->next() && Token::Match(end->next(), ":: %type%")) while (end && end->next() && Token::Match(end->next(), ":: %type%"))
end = end->tokAt(2); end = end->tokAt(2);
if (!end)
{
// internal error
return;
}
tok = end; tok = end;
} }
else if (Token::Match(tok->next(), "%type%")) else if (Token::Match(tok->next(), "%type%"))