Skip to content

Commit f516bde

Browse files
committed
ExprEngine; Fix TODO assertion
1 parent ab663fe commit f516bde

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

lib/exprengine.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1926,6 +1926,7 @@ static void execute(const Token *start, const Token *end, Data &data)
19261926
tok = tok->tokAt(2);
19271927
continue;
19281928
}
1929+
data.assignValue(tok, tok->varId(), createVariableValue(*tok->variable(), data));
19291930
} else if (tok->variable()->isArray()) {
19301931
data.assignValue(tok, tok->varId(), std::make_shared<ExprEngine::ArrayValue>(&data, tok->variable()));
19311932
if (Token::Match(tok, "%name% ["))

test/testbughuntingchecks.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class TestBughuntingChecks : public TestFixture {
4646

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

5151
check("void foo() { int x; int y = x + 1; }");
5252
ASSERT_EQUALS("[test.cpp:1]: (error) Cannot determine that 'x' is initialized\n", errout.str());

0 commit comments

Comments
 (0)