Skip to content

Commit 2024842

Browse files
committed
update state of inline suppressions if they already exist
1 parent aede3e6 commit 2024842

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

cli/processexecutor.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,11 +244,13 @@ bool ProcessExecutor::handleRead(int rpipe, unsigned int &result, const std::str
244244
suppr.isInline = true;
245245
suppr.checked = parts[1] == "1";
246246
suppr.matched = parts[2] == "1";
247-
const std::string err = mSuppressions.addSuppression(std::move(suppr));
247+
const std::string err = mSuppressions.addSuppression(suppr);
248248
if (!err.empty()) {
249+
// TODO: only update state if it doesn't exist - otherwise propagate error
250+
mSuppressions.updateSuppressionState(suppr); // TODO: check result
249251
// TODO: make this non-fatal
250-
std::cerr << "#### ThreadExecutor::handleRead(" << filename << ") adding of inline suppression failed - " << err << std::endl;
251-
std::exit(EXIT_FAILURE);
252+
//std::cerr << "#### ThreadExecutor::handleRead(" << filename << ") adding of inline suppression failed - " << err << std::endl;
253+
//std::exit(EXIT_FAILURE);
252254
}
253255
}
254256
} else if (type == PipeWriter::CHILD_END) {

cli/threadexecutor.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,11 @@ class ThreadData
128128
for (const auto& suppr : fileChecker.settings().supprs.nomsg.getSuppressions()) {
129129
// need to transfer all inline suppressions because these are used later on
130130
if (suppr.isInline) {
131-
mSuppressions.addSuppression(suppr); // TODO: check result
131+
const std::string err = mSuppressions.addSuppression(suppr);
132+
if (!err.empty()) {
133+
// TODO: only update state if it doesn't exist - otherwise propagate error
134+
mSuppressions.updateSuppressionState(suppr); // TODO: check result
135+
}
132136
continue;
133137
}
134138

0 commit comments

Comments
 (0)