Skip to content

Commit 35d487d

Browse files
committed
Fix issue introduced in 804926c with regards to "unmatchedSuppression".
Instead of returning immediately just avoid calling isMatch when a match is already found and the suppression being checked has previously been matched.
1 parent 804926c commit 35d487d

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

lib/suppressions.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -475,16 +475,18 @@ bool SuppressionList::isSuppressed(const SuppressionList::ErrorMessage &errmsg,
475475

476476
// TODO: handle unmatchedPolyspaceSuppression?
477477
const bool unmatchedSuppression(errmsg.errorId == "unmatchedSuppression");
478-
478+
bool returnValue = false;
479479
for (Suppression &s : mSuppressions) {
480480
if (!global && !s.isLocal())
481481
continue;
482482
if (unmatchedSuppression && s.errorId != errmsg.errorId)
483483
continue;
484+
if (returnValue && s.matched)
485+
continue;
484486
if (s.isMatch(errmsg))
485-
return true;
487+
returnValue = true;
486488
}
487-
return false;
489+
return returnValue;
488490
}
489491

490492
bool SuppressionList::isSuppressedExplicitly(const SuppressionList::ErrorMessage &errmsg, bool global)

0 commit comments

Comments
 (0)