Skip to content

Commit

Permalink
fixed #10760 - added file name to ValueFlow --debug output [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
firewave committed Nov 13, 2023
1 parent d352094 commit 3b3e539
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions lib/token.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1701,6 +1701,7 @@ void Token::printValueFlow(bool xml, std::ostream &out) const
{
std::string outs;

int fileIndex = -1;
int line = 0;
if (xml)
outs += " <valueflow>\n";
Expand All @@ -1718,11 +1719,19 @@ void Token::printValueFlow(bool xml, std::ostream &out) const
outs += "\">";
outs += '\n';
}
else if (line != tok->linenr()) {
outs += "Line ";
outs += std::to_string(tok->linenr());
outs += '\n';
else {
if (fileIndex != tok->fileIndex()) {
outs += "File ";
outs += tok->mTokensFrontBack->list->getFiles()[tok->fileIndex()];
outs += '\n';
}
if (line != tok->linenr()) {
outs += "Line ";
outs += std::to_string(tok->linenr());
outs += '\n';
}
}
fileIndex = tok->fileIndex();
line = tok->linenr();
if (!xml) {
ValueFlow::Value::ValueKind valueKind = values->front().valueKind;
Expand Down

0 comments on commit 3b3e539

Please sign in to comment.