ExprEngine; Fix TODO assertion

This commit is contained in:
Daniel Marjamäki 2020-06-19 14:05:19 +02:00
parent ab663feea8
commit f516bde744
2 changed files with 2 additions and 1 deletions

View File

@ -1926,6 +1926,7 @@ static void execute(const Token *start, const Token *end, Data &data)
tok = tok->tokAt(2);
continue;
}
data.assignValue(tok, tok->varId(), createVariableValue(*tok->variable(), data));
} else if (tok->variable()->isArray()) {
data.assignValue(tok, tok->varId(), std::make_shared<ExprEngine::ArrayValue>(&data, tok->variable()));
if (Token::Match(tok, "%name% ["))

View File

@ -46,7 +46,7 @@ private:
void uninit() {
check("void foo() { int x; x = x + 1; }");
TODO_ASSERT_EQUALS("[test.cpp:1]: (error) Cannot determine that 'x' is initialized\n", "", errout.str());
ASSERT_EQUALS("[test.cpp:1]: (error) Cannot determine that 'x' is initialized\n", errout.str());
check("void foo() { int x; int y = x + 1; }");
ASSERT_EQUALS("[test.cpp:1]: (error) Cannot determine that 'x' is initialized\n", errout.str());