Fixed #2020 (false positive: (error) Uninitialized variable, used in asm statement)

This commit is contained in:
Daniel Marjamäki 2010-09-05 08:06:37 +02:00
parent 51bc784537
commit 7d3ccb064b
2 changed files with 2 additions and 1 deletions

View File

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

View File

@ -537,6 +537,7 @@ private:
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));"));
ASSERT_EQUALS("; asm ( ) ;", tokenizeAndStringify("; __asm __volatile__ (\"ddd\") ;"));
}