From 42bb74434abe9fb7487cb4ee33c440576217de5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludvig=20Gunne=20Lindstr=C3=B6m?= Date: Thu, 4 Sep 2025 16:46:37 +0200 Subject: [PATCH 1/2] update existing tests --- test/testleakautovar.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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() { From 2a0ec2a67a0d36113d12c1f3db2ec891293ccc74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludvig=20Gunne=20Lindstr=C3=B6m?= Date: Thu, 4 Sep 2025 16:46:18 +0200 Subject: [PATCH 2/2] fix #13854 --- lib/tokenize.cpp | 2 ++ 1 file changed, 2 insertions(+) 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;