Fixed varId0 message #6443.
This commit is contained in:
parent
57ec1aea91
commit
33f5d27b53
|
@ -1603,6 +1603,8 @@ static void valueFlowSubFunction(TokenList *tokenlist, ErrorLogger *errorLogger,
|
|||
|
||||
// Set value in function scope..
|
||||
const unsigned int varid2 = arg->declarationId();
|
||||
if (!varid2)
|
||||
continue;
|
||||
for (const Token *tok2 = functionScope->classStart->next(); tok2 != functionScope->classEnd; tok2 = tok2->next()) {
|
||||
if (Token::Match(tok2, "%varid% !!=", varid2)) {
|
||||
for (std::list<ValueFlow::Value>::const_iterator val = argvalues.begin(); val != argvalues.end(); ++val)
|
||||
|
|
|
@ -385,7 +385,7 @@ private:
|
|||
"{\n"
|
||||
" (foo(s, , 2, , , 5, , 7)) abort()\n"
|
||||
"}\n";
|
||||
ASSERT_THROW(checkCode(code), InternalError);
|
||||
checkCode(code);
|
||||
|
||||
// #6106
|
||||
code = " f { int i ; b2 , [ ] ( for ( i = 0 ; ; ) ) }";
|
||||
|
|
|
@ -1395,6 +1395,12 @@ private:
|
|||
" dostuff(x+1);\n"
|
||||
"}\n";
|
||||
ASSERT_EQUALS(true, testValueOfX(code, 2U, 2));
|
||||
|
||||
code = "void leaveNotifyEvent(const XCrossingEvent * const) { }\n"
|
||||
"void motionNotifyEvent() {\n"
|
||||
" leaveNotifyEvent(0);\n"
|
||||
"}";
|
||||
testValueOfX(code, 2U, 2); // No complaint about Token::Match called with varid 0. (#6443)
|
||||
}
|
||||
|
||||
void valueFlowFunctionReturn() {
|
||||
|
|
Loading…
Reference in New Issue