diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index 584f402db..16905b21a 100755 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -10069,7 +10069,7 @@ const Token *Tokenizer::findSQLBlockEnd(const Token *tokSQLStart) if (Token::simpleMatch(tok->tokAt(-2), "END - __CPPCHECK_EMBEDDED_SQL_EXEC__ ;")) return tok->next(); return tokLastEnd; - } else if (Token::Match(tok, "{|}|==|&&|!|&|^|<<|>>|++|+=|-=|/=|*=|>>=|<<=|->|::|~")) + } else if (Token::Match(tok, "{|}|==|&&|!|^|<<|>>|++|+=|-=|/=|*=|>>=|<<=|~")) break; // We are obviously outside the SQL block } diff --git a/test/testtokenize.cpp b/test/testtokenize.cpp index 91e842ded..fdb1b7aee 100755 --- a/test/testtokenize.cpp +++ b/test/testtokenize.cpp @@ -5829,6 +5829,7 @@ private: ASSERT_THROW(tokenizeAndStringify("int f(){ __CPPCHECK_EMBEDDED_SQL_EXEC__ SQL } int a;",false), InternalError); ASSERT_THROW(tokenizeAndStringify("__CPPCHECK_EMBEDDED_SQL_EXEC__ SQL int f(){",false), InternalError); ASSERT_THROW(tokenizeAndStringify("__CPPCHECK_EMBEDDED_SQL_EXEC__ SQL END-__CPPCHECK_EMBEDDED_SQL_EXEC__ int a;",false), InternalError); + ASSERT_NO_THROW(tokenizeAndStringify("__CPPCHECK_EMBEDDED_SQL_EXEC__ SQL UPDATE A SET B = :&b->b1, C = :c::c1;",false)); } void simplifyCAlternativeTokens() {