From f516bde744873244a33d4f68e2979a359ed4cab9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Fri, 19 Jun 2020 14:05:19 +0200 Subject: [PATCH] ExprEngine; Fix TODO assertion --- lib/exprengine.cpp | 1 + test/testbughuntingchecks.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) 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());