member access operators are allowed inside the embedded SQL block when (#1043)
passing arguments for a query
This commit is contained in:
parent
2b3def6be1
commit
913fdf44b6
|
@ -10069,7 +10069,7 @@ const Token *Tokenizer::findSQLBlockEnd(const Token *tokSQLStart)
|
||||||
if (Token::simpleMatch(tok->tokAt(-2), "END - __CPPCHECK_EMBEDDED_SQL_EXEC__ ;"))
|
if (Token::simpleMatch(tok->tokAt(-2), "END - __CPPCHECK_EMBEDDED_SQL_EXEC__ ;"))
|
||||||
return tok->next();
|
return tok->next();
|
||||||
return tokLastEnd;
|
return tokLastEnd;
|
||||||
} else if (Token::Match(tok, "{|}|==|&&|!|&|^|<<|>>|++|+=|-=|/=|*=|>>=|<<=|->|::|~"))
|
} else if (Token::Match(tok, "{|}|==|&&|!|^|<<|>>|++|+=|-=|/=|*=|>>=|<<=|~"))
|
||||||
break; // We are obviously outside the SQL block
|
break; // We are obviously outside the SQL block
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5829,6 +5829,7 @@ private:
|
||||||
ASSERT_THROW(tokenizeAndStringify("int f(){ __CPPCHECK_EMBEDDED_SQL_EXEC__ SQL } int a;",false), InternalError);
|
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 int f(){",false), InternalError);
|
||||||
ASSERT_THROW(tokenizeAndStringify("__CPPCHECK_EMBEDDED_SQL_EXEC__ SQL END-__CPPCHECK_EMBEDDED_SQL_EXEC__ int a;",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() {
|
void simplifyCAlternativeTokens() {
|
||||||
|
|
Loading…
Reference in New Issue