diff --git a/lib/exprengine.cpp b/lib/exprengine.cpp index fbef3eaec..d062e6881 100644 --- a/lib/exprengine.cpp +++ b/lib/exprengine.cpp @@ -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(&data, tok->variable())); if (Token::Match(tok, "%name% [")) diff --git a/test/testbughuntingchecks.cpp b/test/testbughuntingchecks.cpp index 8086e8620..ce225d238 100644 --- a/test/testbughuntingchecks.cpp +++ b/test/testbughuntingchecks.cpp @@ -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());