parent
0e57c27dd3
commit
89dba226dd
|
@ -2970,7 +2970,7 @@ ExprUsage getExprUsage(const Token* tok, int indirect, const Settings* settings)
|
||||||
if (Token::simpleMatch(tok->astParent(), "=") && astIsRHS(tok))
|
if (Token::simpleMatch(tok->astParent(), "=") && astIsRHS(tok))
|
||||||
return ExprUsage::Used;
|
return ExprUsage::Used;
|
||||||
// Function call or index
|
// Function call or index
|
||||||
if (Token::Match(tok->astParent(), "(|[") && !tok->astParent()->isCast() &&
|
if (((Token::simpleMatch(tok->astParent(), "(") && !tok->astParent()->isCast()) || (Token::simpleMatch(tok->astParent(), "[") && tok->valueType())) &&
|
||||||
(astIsLHS(tok) || Token::simpleMatch(tok->astParent(), "( )")))
|
(astIsLHS(tok) || Token::simpleMatch(tok->astParent(), "( )")))
|
||||||
return ExprUsage::Used;
|
return ExprUsage::Used;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6363,6 +6363,12 @@ private:
|
||||||
" return L[0][0];\n"
|
" return L[0][0];\n"
|
||||||
"}\n");
|
"}\n");
|
||||||
ASSERT_EQUALS("", errout.str());
|
ASSERT_EQUALS("", errout.str());
|
||||||
|
|
||||||
|
valueFlowUninit("void f() {\n" // #11305
|
||||||
|
" type_t a;\n"
|
||||||
|
" a[0] = 0;\n"
|
||||||
|
"}\n", "test.c");
|
||||||
|
ASSERT_EQUALS("", errout.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void uninitvar_memberaccess() {
|
void uninitvar_memberaccess() {
|
||||||
|
|
Loading…
Reference in New Issue