Fixed #1781 (false positive: uninitialized variable when using asm statement in macro)

This commit is contained in:
Daniel Marjamäki 2010-06-09 21:28:15 +02:00
parent c9cd5ea250
commit e64ce2e812
2 changed files with 8 additions and 0 deletions

View File

@ -1687,6 +1687,13 @@ bool Tokenizer::tokenize(std::istream &code, const char FileName[], const std::s
Token::eraseTokens(tok, tok->tokAt(3)->link()->next());
}
else if (Token::Match(tok->next(), "asm volatile (") &&
tok->tokAt(3)->link() &&
tok->tokAt(3)->link()->next())
{
Token::eraseTokens(tok, tok->tokAt(3)->link()->next());
}
else if (Token::simpleMatch(tok->next(), "__asm"))
{
const Token *tok2 = tok->next();

View File

@ -418,6 +418,7 @@ private:
ASSERT_EQUALS("; asm ( ) ;", tokenizeAndStringify(";__asm__ __volatile__ ( \"mov ax,bx\" );"));
ASSERT_EQUALS("; asm ( ) ;", tokenizeAndStringify(";__asm _emit 12h ;"));
ASSERT_EQUALS("; asm ( ) ;", tokenizeAndStringify(";__asm mov a, b ;"));
ASSERT_EQUALS("; asm ( ) ;", tokenizeAndStringify(";asm volatile (\"fnstcw %0\" : \"= m\" (old_cw));"));
}