Fixed crash in clang test suite introduced by previous commit.
This commit is contained in:
parent
b049050792
commit
b97f9e576d
|
@ -9294,7 +9294,7 @@ void Tokenizer::simplifyAsm2()
|
|||
for (Token *tok = list.front(); tok; tok = tok->next()) {
|
||||
if (Token::simpleMatch(tok, "^ {")) {
|
||||
Token * start = tok;
|
||||
while (start && !Token::Match(start, "[;{})]")) {
|
||||
while (start && !Token::Match(start, "[;{})=]")) {
|
||||
start = start->previous();
|
||||
}
|
||||
if (start)
|
||||
|
@ -9304,6 +9304,7 @@ void Tokenizer::simplifyAsm2()
|
|||
last = last->next();
|
||||
while (last && !Token::Match(last->next(), "[;{})]"))
|
||||
last = last->next();
|
||||
if (last)
|
||||
last = last->next();
|
||||
}
|
||||
if (start && last) {
|
||||
|
|
|
@ -789,6 +789,11 @@ private:
|
|||
" return sizeof...(args);\n"
|
||||
" }();\n"
|
||||
"};"));
|
||||
ASSERT_EQUALS("int ( ^ block ) ( void ) = asm ( \"^{staticinttest=0;returntest;}\" ) ;",
|
||||
tokenizeAndStringify("int(^block)(void) = ^{\n"
|
||||
" static int test = 0;\n"
|
||||
" return test;\n"
|
||||
"};"));
|
||||
}
|
||||
|
||||
// #3503 - don't "simplify" SetFunction member function to a variable
|
||||
|
|
Loading…
Reference in New Issue