From 8173aa8d699940f572669187a21c3ce9013a29d9 Mon Sep 17 00:00:00 2001 From: Oleksandr Labetskyi Date: Mon, 10 Jun 2024 18:19:53 +0300 Subject: [PATCH] Fix #12383: cppcheck build dir: changed line numbers in source file --- lib/preprocessor.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/preprocessor.cpp b/lib/preprocessor.cpp index 738862e42eb..4ad0aea66ff 100644 --- a/lib/preprocessor.cpp +++ b/lib/preprocessor.cpp @@ -952,13 +952,17 @@ std::size_t Preprocessor::calculateHash(const simplecpp::TokenList &tokens1, con { std::string hashData = toolinfo; for (const simplecpp::Token *tok = tokens1.cfront(); tok; tok = tok->next) { - if (!tok->comment) + if (!tok->comment) { hashData += tok->str(); + hashData += tok->location.line / tok->location.col; + } } for (std::map::const_iterator it = mTokenLists.cbegin(); it != mTokenLists.cend(); ++it) { for (const simplecpp::Token *tok = it->second->cfront(); tok; tok = tok->next) { - if (!tok->comment) + if (!tok->comment) { hashData += tok->str(); + hashData += tok->location.line / tok->location.col; + } } } return (std::hash{})(hashData);