diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index ea911b1acbe..d88610b731a 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -6801,6 +6801,7 @@ Token *Tokenizer::simplifyAddBracesPair(Token *tok, bool commandWithCondition) } tokEnd->insertToken("}"); Token * tokCloseBrace = tokEnd->next(); + tokCloseBrace->column(tokEnd->column()); Token::createMutualLinks(tokOpenBrace, tokCloseBrace); tokBracesEnd = tokCloseBrace; @@ -6835,6 +6836,7 @@ Token *Tokenizer::simplifyAddBracesPair(Token *tok, bool commandWithCondition) tokEnd->insertToken("}"); Token * tokCloseBrace=tokEnd->next(); + tokCloseBrace->column(tokEnd->column()); Token::createMutualLinks(tokOpenBrace,tokCloseBrace); tokBracesEnd=tokCloseBrace; diff --git a/test/testleakautovar.cpp b/test/testleakautovar.cpp index 74b6b05c36d..c50dc44d9d9 100644 --- a/test/testleakautovar.cpp +++ b/test/testleakautovar.cpp @@ -2230,8 +2230,8 @@ class TestLeakAutoVar : public TestFixture { " void * p2 = malloc(2);\n" " return;\n" "}"); - ASSERT_EQUALS("[test.c:3:0]: (error) Memory leak: p1 [memleak]\n" - "[test.c:5:0]: (error) Memory leak: p2 [memleak]\n", errout_str()); + ASSERT_EQUALS("[test.c:3:30]: (error) Memory leak: p1 [memleak]\n" + "[test.c:5:30]: (error) Memory leak: p2 [memleak]\n", errout_str()); check("void f() {\n" " if (x > 0)\n" @@ -2239,8 +2239,8 @@ class TestLeakAutoVar : public TestFixture { " else\n" " void * p2 = malloc(2);\n" "}"); - ASSERT_EQUALS("[test.c:3:0]: (error) Memory leak: p1 [memleak]\n" - "[test.c:5:0]: (error) Memory leak: p2 [memleak]\n", errout_str()); + ASSERT_EQUALS("[test.c:3:30]: (error) Memory leak: p1 [memleak]\n" + "[test.c:5:30]: (error) Memory leak: p2 [memleak]\n", errout_str()); } void ifelse21() {