From 7d3ccb064b0e8205a54aff60865c460125610695 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sun, 5 Sep 2010 08:06:37 +0200 Subject: [PATCH] Fixed #2020 (false positive: (error) Uninitialized variable, used in asm statement) --- lib/tokenize.cpp | 2 +- test/testtokenize.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index 1fc83f18c..7427d4826 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -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()) { diff --git a/test/testtokenize.cpp b/test/testtokenize.cpp index 9cd994c3a..419a26efd 100644 --- a/test/testtokenize.cpp +++ b/test/testtokenize.cpp @@ -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\") ;")); }