Skip to content

Commit be6e4a1

Browse files
authored
some ProgressReporter fixes (danmar#8368)
- avoid unwanted `reportProgress` call in `~ProgressReporter` - fixed progress interval in `ValueFlowPassRunner::run()`
1 parent b70e34d commit be6e4a1

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lib/errorlogger.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,8 @@ class CPPCHECKLIB ProgressReporter {
299299
}
300300

301301
~ProgressReporter() {
302+
if (mReportProgressInterval < 0)
303+
return;
302304
mErrorLogger.reportProgress(mFilename, mStage.c_str(), 100);
303305
}
304306

lib/valueflow.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7212,7 +7212,7 @@ struct ValueFlowPassRunner {
72127212
values = getTotalValues();
72137213
const std::string passnum = std::to_string(state.settings.vfOptions.maxIterations - n + 1);
72147214
if (std::any_of(passes.begin(), passes.end(), [&](const ValuePtr<ValueFlowPass>& pass) {
7215-
ProgressReporter progressReporter(state.errorLogger, state.settings.reportProgress >= 0, state.tokenlist.getSourceFilePath(), std::string("ValueFlow::") + pass->name() + (' ' + passnum));
7215+
ProgressReporter progressReporter(state.errorLogger, state.settings.reportProgress, state.tokenlist.getSourceFilePath(), std::string("ValueFlow::") + pass->name() + (' ' + passnum));
72167216
return run(pass);
72177217
}))
72187218
return true;

0 commit comments

Comments
 (0)