Skip to content

Commit 8173aa8

Browse files
committed
Fix #12383: cppcheck build dir: changed line numbers in source file
1 parent 99674e1 commit 8173aa8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/preprocessor.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -952,13 +952,17 @@ std::size_t Preprocessor::calculateHash(const simplecpp::TokenList &tokens1, con
952952
{
953953
std::string hashData = toolinfo;
954954
for (const simplecpp::Token *tok = tokens1.cfront(); tok; tok = tok->next) {
955-
if (!tok->comment)
955+
if (!tok->comment) {
956956
hashData += tok->str();
957+
hashData += tok->location.line / tok->location.col;
958+
}
957959
}
958960
for (std::map<std::string, simplecpp::TokenList *>::const_iterator it = mTokenLists.cbegin(); it != mTokenLists.cend(); ++it) {
959961
for (const simplecpp::Token *tok = it->second->cfront(); tok; tok = tok->next) {
960-
if (!tok->comment)
962+
if (!tok->comment) {
961963
hashData += tok->str();
964+
hashData += tok->location.line / tok->location.col;
965+
}
962966
}
963967
}
964968
return (std::hash<std::string>{})(hashData);

0 commit comments

Comments
 (0)