Fixed #1942 (false positive: uninitialized variable in __asm__ statement)

This commit is contained in:
Daniel Marjamäki 2010-08-16 19:38:47 +02:00
parent cc079462dd
commit 64cdee62ef
2 changed files with 8 additions and 0 deletions

View File

@ -7820,6 +7820,13 @@ void Tokenizer::simplifyAsm()
Token::eraseTokens(tok, tok->tokAt(2)->link()->next());
}
else if (Token::Match(tok->next(), "__asm__ (") &&
tok->tokAt(2)->link() &&
tok->tokAt(2)->link()->next())
{
Token::eraseTokens(tok, tok->tokAt(2)->link()->next());
}
else if (Token::Match(tok->next(), "__asm__ __volatile__ (") &&
tok->tokAt(3)->link() &&
tok->tokAt(3)->link()->next())

View File

@ -463,6 +463,7 @@ private:
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));"));
ASSERT_EQUALS("; asm ( ) ;", tokenizeAndStringify("; __asm__ (\"fnstcw %0\" : \"= m\" (old_cw));"));
}