Fixed #1781 (false positive: uninitialized variable when using asm statement in macro)
This commit is contained in:
parent
c9cd5ea250
commit
e64ce2e812
|
@ -1687,6 +1687,13 @@ bool Tokenizer::tokenize(std::istream &code, const char FileName[], const std::s
|
||||||
Token::eraseTokens(tok, tok->tokAt(3)->link()->next());
|
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"))
|
else if (Token::simpleMatch(tok->next(), "__asm"))
|
||||||
{
|
{
|
||||||
const Token *tok2 = tok->next();
|
const Token *tok2 = tok->next();
|
||||||
|
|
|
@ -418,6 +418,7 @@ private:
|
||||||
ASSERT_EQUALS("; asm ( ) ;", tokenizeAndStringify(";__asm__ __volatile__ ( \"mov ax,bx\" );"));
|
ASSERT_EQUALS("; asm ( ) ;", tokenizeAndStringify(";__asm__ __volatile__ ( \"mov ax,bx\" );"));
|
||||||
ASSERT_EQUALS("; asm ( ) ;", tokenizeAndStringify(";__asm _emit 12h ;"));
|
ASSERT_EQUALS("; asm ( ) ;", tokenizeAndStringify(";__asm _emit 12h ;"));
|
||||||
ASSERT_EQUALS("; asm ( ) ;", tokenizeAndStringify(";__asm mov a, b ;"));
|
ASSERT_EQUALS("; asm ( ) ;", tokenizeAndStringify(";__asm mov a, b ;"));
|
||||||
|
ASSERT_EQUALS("; asm ( ) ;", tokenizeAndStringify(";asm volatile (\"fnstcw %0\" : \"= m\" (old_cw));"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue